Debian Codegraph @

rhino/testsrc/tests/ecma_3/ExecutionContexts/10.1.4-1.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 var gTestfile = '10.1.4-1.js';
8
9 /**
10 ECMA Section: 10.1.4.1 Entering An Execution Context
11 ECMA says:
12 * Global Code, Function Code
13 Variable instantiation is performed using the global object as the
14 variable object and using property attributes { DontDelete }.
15
16 * Eval Code
17 Variable instantiation is performed using the calling context's
18 variable object and using empty property attributes.
19 */
20
21 var BUGNUMBER = '(none)';
22 var summary = '10.1.4.1 Entering An Execution Context';
23 var actual = '';
24 var expect = '';
25
26 test();
27
28 function test()
29 {
30 enterFunc ("test");
31 printBugNumber(BUGNUMBER);
32 printStatus (summary);
33
34 var y;
35 eval("var x = 1");
36
37 if (delete y)
38 reportCompare('PASS', 'FAIL', "Expected *NOT* to be able to delete y");
39
40 if (typeof x == "undefined")
41 reportCompare('PASS', 'FAIL', "x did not remain defined after eval()");
42 else if (x != 1)
43 reportCompare('PASS', 'FAIL', "x did not retain it's value after eval()");
44
45 if (!delete x)
46 reportCompare('PASS', 'FAIL', "Expected to be able to delete x");
47
48 reportCompare('PASS', 'PASS', '10.1.4.1 Entering An Execution Context');
49
50 exitFunc("test");
51 }