michael@0: /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 531682; michael@0: var summary = 'Checking proper wrapping of scope in eval(source, scope)'; michael@0: var actual; michael@0: var expect; michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var x = 0; michael@0: michael@0: test(); michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: function scope1() { michael@0: eval('var x = 1;'); michael@0: return function() { return x; } michael@0: } michael@0: michael@0: function test() { michael@0: enterFunc ('test'); michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: // The scope chain in eval should be just scope1() and the global object. michael@0: actual = eval('x', scope1()); michael@0: expect = 0; michael@0: reportCompare(expect, actual, summary); michael@0: exitFunc ('test'); michael@0: }