|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 /** |
|
8 File Name: 10.2.1.js |
|
9 ECMA Section: 10.2.1 Global Code |
|
10 Description: |
|
11 |
|
12 The scope chain is created and initialized to contain the global object and |
|
13 no others. |
|
14 |
|
15 Variable instantiation is performed using the global object as the variable |
|
16 object and using empty property attributes. |
|
17 |
|
18 The this value is the global object. |
|
19 Author: christine@netscape.com |
|
20 Date: 12 november 1997 |
|
21 */ |
|
22 |
|
23 var SECTION = "10.2.1"; |
|
24 var VERSION = "ECMA_1"; |
|
25 startTest(); |
|
26 var TITLE = "Global Code"; |
|
27 |
|
28 writeHeaderToLog( SECTION + " "+ TITLE); |
|
29 |
|
30 var THIS = this; |
|
31 |
|
32 new TestCase( SECTION, |
|
33 "this +''", |
|
34 GLOBAL, |
|
35 THIS + "" ); |
|
36 |
|
37 var GLOBAL_PROPERTIES = new Array(); |
|
38 var i = 0; |
|
39 |
|
40 for ( p in this ) { |
|
41 GLOBAL_PROPERTIES[i++] = p; |
|
42 } |
|
43 |
|
44 for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { |
|
45 new TestCase( SECTION, |
|
46 GLOBAL_PROPERTIES[i] +" == void 0", |
|
47 false, |
|
48 eval("GLOBAL_PROPERTIES["+i+"] == void 0")); |
|
49 } |
|
50 |
|
51 test(); |