js/src/tests/ecma/ExecutionContexts/10.1.5-2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 File Name: 10.1.5-2.js
michael@0 9 ECMA Section: 10.1.5 Global Object
michael@0 10 Description:
michael@0 11 There is a unique global object which is created before control enters
michael@0 12 any execution context. Initially the global object has the following
michael@0 13 properties:
michael@0 14
michael@0 15 Built-in objects such as Math, String, Date, parseInt, etc. These have
michael@0 16 attributes { DontEnum }.
michael@0 17
michael@0 18 Additional host defined properties. This may include a property whose
michael@0 19 value is the global object itself, for example window in HTML.
michael@0 20
michael@0 21 As control enters execution contexts, and as ECMAScript code is executed,
michael@0 22 additional properties may be added to the global object and the initial
michael@0 23 properties may be changed.
michael@0 24
michael@0 25 Author: christine@netscape.com
michael@0 26 Date: 12 november 1997
michael@0 27 */
michael@0 28 var SECTION = "10.5.1-2";
michael@0 29 var VERSION = "ECMA_1";
michael@0 30 startTest();
michael@0 31
michael@0 32 writeHeaderToLog( SECTION + " Global Object");
michael@0 33
michael@0 34 new TestCase( "SECTION", "Eval Code check" );
michael@0 35
michael@0 36 var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' +
michael@0 37 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' +
michael@0 38 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' +
michael@0 39 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' +
michael@0 40 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' +
michael@0 41 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' +
michael@0 42 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' +
michael@0 43 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' +
michael@0 44 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' +
michael@0 45 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ;
michael@0 46
michael@0 47 eval( EVAL_STRING );
michael@0 48
michael@0 49 /*
michael@0 50 if ( NaN == null ) {
michael@0 51 gTestcases[0].reason += " NaN == null";
michael@0 52 }
michael@0 53 if ( Infinity == null ) {
michael@0 54 gTestcases[0].reason += " Infinity == null";
michael@0 55 }
michael@0 56 */
michael@0 57
michael@0 58 if ( gTestcases[0].reason != "" ) {
michael@0 59 gTestcases[0].actual = "fail";
michael@0 60 } else {
michael@0 61 gTestcases[0].actual = "pass";
michael@0 62 }
michael@0 63 gTestcases[0].expect = "pass";
michael@0 64
michael@0 65 test();
michael@0 66

mercurial