michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Using arguments object within a "with" Expression that is nested in a function is admitted michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A18_T2.js michael@0: * @description Object is declared with "__obj={callee:"a"}" michael@0: */ michael@0: michael@0: this.callee = 0; michael@0: var b; michael@0: michael@0: __obj={callee:"a"}; michael@0: michael@0: function f(){ michael@0: with (arguments){ michael@0: callee=1; michael@0: b=true; michael@0: return arguments; michael@0: } michael@0: }; michael@0: michael@0: result=f(__obj); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (callee !== 0) { michael@0: $ERROR('#1: callee === 0. Actual: callee ==='+callee); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__obj.callee !== "a") { michael@0: $ERROR('#2: __obj.callee === "a". Actual: __obj.callee ==='+__obj.callee); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (result.callee !== 1) { michael@0: $ERROR('#3: result.callee === 1. Actual: result.callee ==='+result.callee); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: if (!(this.b)) { michael@0: $ERROR('#4: this.b === true. Actual: this.b ==='+this.b); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: