| 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 | gTestfile = '10.2.1.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: 10.2.1.js |
| 10 | ECMA Section: 10.2.1 Global Code |
| 11 | Description: |
| 12 | |
| 13 | The scope chain is created and initialized to contain the global object and |
| 14 | no others. |
| 15 | |
| 16 | Variable instantiation is performed using the global object as the variable |
| 17 | object and using empty property attributes. |
| 18 | |
| 19 | The this value is the global object. |
| 20 | Author: [email protected] |
| 21 | Date: 12 november 1997 |
| 22 | */ |
| 23 | |
| 24 | var SECTION = "10.2.1"; |
| 25 | var VERSION = "ECMA_1"; |
| 26 | startTest(); |
| 27 | var TITLE = "Global Code"; |
| 28 | |
| 29 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 30 | |
| 31 | var THIS = this; |
| 32 | |
| 33 | new TestCase( SECTION, |
| 34 | "this +''", |
| 35 | GLOBAL, |
| 36 | THIS + "" ); |
| 37 | |
| 38 | var GLOBAL_PROPERTIES = new Array(); |
| 39 | var i = 0; |
| 40 | |
| 41 | for ( p in this ) { |
| 42 | GLOBAL_PROPERTIES[i++] = p; |
| 43 | } |
| 44 | |
| 45 | for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { |
| 46 | new TestCase( SECTION, |
| 47 | GLOBAL_PROPERTIES[i] +" == void 0", |
| 48 | false, |
| 49 | eval("GLOBAL_PROPERTIES["+i+"] == void 0")); |
| 50 | } |
| 51 | |
| 52 | test(); |