1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch13/13.2/S13.2.2_A18_T2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * Using arguments object within a "with" Expression that is nested in a function is admitted 1.9 + * 1.10 + * @path ch13/13.2/S13.2.2_A18_T2.js 1.11 + * @description Object is declared with "__obj={callee:"a"}" 1.12 + */ 1.13 + 1.14 +this.callee = 0; 1.15 +var b; 1.16 + 1.17 +__obj={callee:"a"}; 1.18 + 1.19 +function f(){ 1.20 + with (arguments){ 1.21 + callee=1; 1.22 + b=true; 1.23 + return arguments; 1.24 + } 1.25 +}; 1.26 + 1.27 +result=f(__obj); 1.28 + 1.29 +////////////////////////////////////////////////////////////////////////////// 1.30 +//CHECK#1 1.31 +if (callee !== 0) { 1.32 + $ERROR('#1: callee === 0. Actual: callee ==='+callee); 1.33 +} 1.34 +// 1.35 +////////////////////////////////////////////////////////////////////////////// 1.36 + 1.37 +////////////////////////////////////////////////////////////////////////////// 1.38 +//CHECK#2 1.39 +if (__obj.callee !== "a") { 1.40 + $ERROR('#2: __obj.callee === "a". Actual: __obj.callee ==='+__obj.callee); 1.41 +} 1.42 +// 1.43 +////////////////////////////////////////////////////////////////////////////// 1.44 + 1.45 +////////////////////////////////////////////////////////////////////////////// 1.46 +//CHECK#3 1.47 +if (result.callee !== 1) { 1.48 + $ERROR('#3: result.callee === 1. Actual: result.callee ==='+result.callee); 1.49 +} 1.50 +// 1.51 +////////////////////////////////////////////////////////////////////////////// 1.52 + 1.53 +////////////////////////////////////////////////////////////////////////////// 1.54 +//CHECK#4 1.55 +if (!(this.b)) { 1.56 + $ERROR('#4: this.b === true. Actual: this.b ==='+this.b); 1.57 +} 1.58 +// 1.59 +////////////////////////////////////////////////////////////////////////////// 1.60 +