Debian Codegraph @

js/src/tests/test262/language/statements/function/S13.2.2_A18_T2.js

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