michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Every execution context has associated with it a scope chain. michael@0: * A scope chain is a list of objects that are searched when evaluating an michael@0: * Identifier michael@0: * michael@0: * @path ch10/10.2/10.2.2/S10.2.2_A1_T8.js michael@0: * @description Checking scope chain containing function declarations and "with" michael@0: * @noStrict michael@0: */ michael@0: michael@0: var x = 0; michael@0: michael@0: var myObj = {x : "obj"}; michael@0: michael@0: function f1(){ michael@0: function f2(){ michael@0: with(myObj){ michael@0: return x; michael@0: } michael@0: }; michael@0: michael@0: var x = 1; michael@0: return f2(); michael@0: } michael@0: michael@0: if(!(f1() === "obj")){ michael@0: $ERROR("#1: Scope chain disturbed"); michael@0: } michael@0: