S13.2.1_A4_T2.js (796B)
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_T2 7 description: > 8 Adding new string property to a function argument within the 9 function body, where explicit argument is an object defined with 10 "__obj={}" 11 ---*/ 12 13 function __func(__arg){ 14 __arg.foo="whiskey gogo"; 15 } 16 17 var __obj={}; 18 19 __func(__obj); 20 21 ////////////////////////////////////////////////////////////////////////////// 22 //CHECK#1 23 if (__obj.foo !== "whiskey gogo") { 24 throw new Test262Error('#1: __obj.foo === "whiskey gogo". Actual: __obj.foo ==='+__obj.foo); 25 } 26 // 27 ////////////////////////////////////////////////////////////////////////////// 28 29 reportCompare(0, 0);