Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Every execution context has associated with it a scope chain. |
michael@0 | 6 | * A scope chain is a list of objects that are searched when evaluating an |
michael@0 | 7 | * Identifier |
michael@0 | 8 | * |
michael@0 | 9 | * @path ch10/10.2/10.2.2/S10.2.2_A1_T8.js |
michael@0 | 10 | * @description Checking scope chain containing function declarations and "with" |
michael@0 | 11 | * @noStrict |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | var x = 0; |
michael@0 | 15 | |
michael@0 | 16 | var myObj = {x : "obj"}; |
michael@0 | 17 | |
michael@0 | 18 | function f1(){ |
michael@0 | 19 | function f2(){ |
michael@0 | 20 | with(myObj){ |
michael@0 | 21 | return x; |
michael@0 | 22 | } |
michael@0 | 23 | }; |
michael@0 | 24 | |
michael@0 | 25 | var x = 1; |
michael@0 | 26 | return f2(); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | if(!(f1() === "obj")){ |
michael@0 | 30 | $ERROR("#1: Scope chain disturbed"); |
michael@0 | 31 | } |
michael@0 | 32 |