js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T6.js

branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
equal deleted inserted replaced
-1:000000000000 0:374fe5ee7718
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 * Every execution context has associated with it a scope chain.
6 * A scope chain is a list of objects that are searched when evaluating an
7 * Identifier
8 *
9 * @path ch10/10.2/10.2.2/S10.2.2_A1_T6.js
10 * @description Checking scope chain containing function declarations and "with"
11 * @noStrict
12 */
13
14 var x = 0;
15
16 var myObj = {x : "obj"};
17
18 function f1(){
19 function f2(){
20 with(myObj){
21 return x;
22 }
23 };
24 return f2();
25 }
26
27 if(!(f1() === "obj")){
28 $ERROR("#1: Scope chain disturbed");
29 }
30

mercurial