1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma/ExecutionContexts/10.2.1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + File Name: 10.2.1.js 1.12 + ECMA Section: 10.2.1 Global Code 1.13 + Description: 1.14 + 1.15 + The scope chain is created and initialized to contain the global object and 1.16 + no others. 1.17 + 1.18 + Variable instantiation is performed using the global object as the variable 1.19 + object and using empty property attributes. 1.20 + 1.21 + The this value is the global object. 1.22 + Author: christine@netscape.com 1.23 + Date: 12 november 1997 1.24 +*/ 1.25 + 1.26 +var SECTION = "10.2.1"; 1.27 +var VERSION = "ECMA_1"; 1.28 +startTest(); 1.29 +var TITLE = "Global Code"; 1.30 + 1.31 +writeHeaderToLog( SECTION + " "+ TITLE); 1.32 + 1.33 +var THIS = this; 1.34 + 1.35 +new TestCase( SECTION, 1.36 + "this +''", 1.37 + GLOBAL, 1.38 + THIS + "" ); 1.39 + 1.40 +var GLOBAL_PROPERTIES = new Array(); 1.41 +var i = 0; 1.42 + 1.43 +for ( p in this ) { 1.44 + GLOBAL_PROPERTIES[i++] = p; 1.45 +} 1.46 + 1.47 +for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { 1.48 + new TestCase( SECTION, 1.49 + GLOBAL_PROPERTIES[i] +" == void 0", 1.50 + false, 1.51 + eval("GLOBAL_PROPERTIES["+i+"] == void 0")); 1.52 +} 1.53 + 1.54 +test();