S13.2.2_A18_T1.js (1659B)
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: | 6 Using arguments object within a "with" Expression that is nested in a 7 function is admitted 8 es5id: 13.2.2_A18_T1 9 description: "Object is declared with \"var __obj={callee:\"a\"}\"" 10 flags: [noStrict] 11 ---*/ 12 13 var callee=0, b; 14 15 var __obj={callee:"a"}; 16 17 result=(function(){ 18 with (arguments){ 19 callee=1; 20 b=true; 21 } 22 return arguments; 23 })(__obj); 24 25 ////////////////////////////////////////////////////////////////////////////// 26 //CHECK#1 27 if (callee !== 0) { 28 throw new Test262Error('#1: callee === 0. Actual: callee ==='+callee); 29 } 30 // 31 ////////////////////////////////////////////////////////////////////////////// 32 33 ////////////////////////////////////////////////////////////////////////////// 34 //CHECK#2 35 if (__obj.callee !== "a") { 36 throw new Test262Error('#2: __obj.callee === "a". Actual: __obj.callee==='+__obj.callee); 37 } 38 // 39 ////////////////////////////////////////////////////////////////////////////// 40 41 ////////////////////////////////////////////////////////////////////////////// 42 //CHECK#3 43 if (result.callee !== 1) { 44 throw new Test262Error('#3: result.callee === 1. Actual: result.callee ==='+result.callee); 45 } 46 // 47 ////////////////////////////////////////////////////////////////////////////// 48 49 ////////////////////////////////////////////////////////////////////////////// 50 //CHECK#4 51 if (!(this.b)) { 52 throw new Test262Error('#4: this.b === true. Actual: this.b ==='+this.b); 53 } 54 // 55 ////////////////////////////////////////////////////////////////////////////// 56 57 reportCompare(0, 0);