Debian Codegraph @

rhino/testsrc/tests/ecma/ExecutionContexts/10.1.5-2.js

raw symbols SCIP
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.1.5-2.js';
7
8 /**
9 File Name: 10.1.5-2.js
10 ECMA Section: 10.1.5 Global Object
11 Description:
12 There is a unique global object which is created before control enters
13 any execution context. Initially the global object has the following
14 properties:
15
16 Built-in objects such as Math, String, Date, parseInt, etc. These have
17 attributes { DontEnum }.
18
19 Additional host defined properties. This may include a property whose
20 value is the global object itself, for example window in HTML.
21
22 As control enters execution contexts, and as ECMAScript code is executed,
23 additional properties may be added to the global object and the initial
24 properties may be changed.
25
26 Author: [email protected]
27 Date: 12 november 1997
28 */
29 var SECTION = "10.5.1-2";
30 var VERSION = "ECMA_1";
31 startTest();
32
33 writeHeaderToLog( SECTION + " Global Object");
34
35 new TestCase( "SECTION", "Eval Code check" );
36
37 var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' +
38 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' +
39 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' +
40 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' +
41 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' +
42 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' +
43 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' +
44 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' +
45 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' +
46 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ;
47
48 eval( EVAL_STRING );
49
50 /*
51 if ( NaN == null ) {
52 gTestcases[0].reason += " NaN == null";
53 }
54 if ( Infinity == null ) {
55 gTestcases[0].reason += " Infinity == null";
56 }
57 */
58
59 if ( gTestcases[0].reason != "" ) {
60 gTestcases[0].actual = "fail";
61 } else {
62 gTestcases[0].actual = "pass";
63 }
64 gTestcases[0].expect = "pass";
65
66 test();
67