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

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

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_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

mercurial