Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
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_T2.js |
michael@0 | 10 | * @description Checking scope chain containing function declarations |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | var x = 0; |
michael@0 | 14 | |
michael@0 | 15 | function f1(){ |
michael@0 | 16 | function f2(){ |
michael@0 | 17 | return x; |
michael@0 | 18 | }; |
michael@0 | 19 | return f2(); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | if(!(f1() === 0)){ |
michael@0 | 23 | $ERROR("#1: Scope chain disturbed"); |
michael@0 | 24 | } |
michael@0 | 25 |