michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: ECMA Section: 10.1.4.1 Entering An Execution Context michael@0: ECMA says: michael@0: * Global Code, Function Code michael@0: Variable instantiation is performed using the global object as the michael@0: variable object and using property attributes { DontDelete }. michael@0: michael@0: * Eval Code michael@0: Variable instantiation is performed using the calling context's michael@0: variable object and using empty property attributes. michael@0: */ michael@0: michael@0: var BUGNUMBER = '(none)'; michael@0: var summary = '10.1.4.1 Entering An Execution Context'; michael@0: var actual = ''; michael@0: var expect = ''; michael@0: michael@0: test(); michael@0: michael@0: function test() michael@0: { michael@0: enterFunc ("test"); michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: var y; michael@0: eval("var x = 1"); michael@0: michael@0: if (delete y) michael@0: reportCompare('PASS', 'FAIL', "Expected *NOT* to be able to delete y"); michael@0: michael@0: if (typeof x == "undefined") michael@0: reportCompare('PASS', 'FAIL', "x did not remain defined after eval()"); michael@0: else if (x != 1) michael@0: reportCompare('PASS', 'FAIL', "x did not retain it's value after eval()"); michael@0: michael@0: if (!delete x) michael@0: reportCompare('PASS', 'FAIL', "Expected to be able to delete x"); michael@0: michael@0: reportCompare('PASS', 'PASS', '10.1.4.1 Entering An Execution Context'); michael@0: michael@0: exitFunc("test"); michael@0: }