S13.2.1_A4_T1.js (760B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Objects as arguments are passed by reference 6 es5id: 13.2.1_A4_T1 7 description: > 8 Adding new number property to a function argument within the 9 function body, where explicit argument is an object defined with 10 "var __obj={}" 11 ---*/ 12 13 function __func(__arg){ 14 __arg.foo=7; 15 } 16 17 var __obj={}; 18 19 __func(__obj); 20 21 ////////////////////////////////////////////////////////////////////////////// 22 //CHECK#1 23 if (__obj.foo !== 7) { 24 throw new Test262Error('#1: __obj.foo === 7. Actual: __obj.foo ==='+__obj.foo); 25 } 26 // 27 ////////////////////////////////////////////////////////////////////////////// 28 29 reportCompare(0, 0);