1/* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
5 *
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
10 *
11 * The Original Code is Mozilla Communicator client code, released March
12 * 31, 1998.
13 *
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
17 * Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 */
22/**
23    File Name:          10.1.5-1.js
24    ECMA Section:       10.1.5 Global Object
25    Description:
26    There is a unique global object which is created before control enters
27    any execution context. Initially the global object has the following
28    properties:
29
30    Built-in objects such as Math, String, Date, parseInt, etc. These have
31    attributes { DontEnum }.
32
33    Additional host defined properties. This may include a property whose
34    value is the global object itself, for example window in HTML.
35
36    As control enters execution contexts, and as ECMAScript code is executed,
37    additional properties may be added to the global object and the initial
38    properties may be changed.
39
40    Author:             christine@netscape.com
41    Date:               12 november 1997
42*/
43    var SECTION = "10.5.1-1";
44    var VERSION = "ECMA_1";
45    startTest();
46
47    writeHeaderToLog( SECTION + " Global Ojbect");
48
49    var testcases = getTestCases();
50
51    if ( Object == null ) {
52        testcases[0].reason += " Object == null" ;
53    }
54    if ( Function == null ) {
55        testcases[0].reason += " Function == null";
56    }
57    if ( String == null ) {
58        testcases[0].reason += " String == null";
59    }
60    if ( Array == null ) {
61        testcases[0].reason += " Array == null";
62    }
63    if ( Number == null ) {
64        testcases[0].reason += " Function == null";
65    }
66    if ( Math == null ) {
67        testcases[0].reason += " Math == null";
68    }
69    if ( Boolean == null ) {
70        testcases[0].reason += " Boolean == null";
71    }
72    if ( Date  == null ) {
73        testcases[0].reason += " Date == null";
74    }
75/*
76    if ( NaN == null ) {
77        testcases[0].reason += " NaN == null";
78    }
79    if ( Infinity == null ) {
80        testcases[0].reason += " Infinity == null";
81    }
82*/
83    if ( eval == null ) {
84        testcases[0].reason += " eval == null";
85    }
86    if ( parseInt == null ) {
87        testcases[0].reason += " parseInt == null";
88    }
89
90    if ( testcases[0].reason != "" ) {
91        testcases[0].actual = "fail";
92    } else {
93        testcases[0].actual = "pass";
94    }
95    testcases[0].expect = "pass";
96
97    test();
98
99function test() {
100    for ( tc=0; tc < testcases.length; tc++ ) {
101        testcases[tc].passed = writeTestCaseResult(
102                            testcases[tc].expect,
103                            testcases[tc].actual,
104                            testcases[tc].description +" = "+
105                            testcases[tc].actual );
106
107    }
108    stopTest();
109    return ( testcases );
110}
111function getTestCases() {
112    var array = new Array();
113    var item = 0;
114
115    array[item++] = new TestCase( "SECTION", "Global Code check" );
116
117    return ( array );
118}
119