S13.2.1_A4_T3.js (776B)
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_T3 7 description: > 8 Adding new number property to a function argument within the 9 function body, where array element "arguments[0]" is an object 10 defined with "__obj={}" 11 ---*/ 12 13 function __func(){ 14 arguments[0]["PI"]=3.14; 15 } 16 17 var __obj={}; 18 19 __func(__obj); 20 21 ////////////////////////////////////////////////////////////////////////////// 22 //CHECK#1 23 if (__obj.PI !== 3.14) { 24 throw new Test262Error('#1: __obj.PI === 3.14. Actual: __obj.PI ==='+__obj.PI); 25 } 26 // 27 ////////////////////////////////////////////////////////////////////////////// 28 29 reportCompare(0, 0);