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