js/src/tests/js1_3/Boolean/boolean-001.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     7 /**
     8  *  File Name:          boolean-001.js
     9  *  Description:
    10  *
    11  *  In JavaScript 1.2, new Boolean(false) evaluates to false.
    12  *
    13  *  Author:             christine@netscape.com
    14  *  Date:               11 August 1998
    15  */
    16 var SECTION = "boolean-001.js";
    17 var VERSION = "JS_1.3";
    18 var TITLE   = "new Boolean(false) should evaluate to false";
    20 startTest();
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 BooleanTest( "new Boolean(true)",  new Boolean(true),  true );
    24 BooleanTest( "new Boolean(false)", new Boolean(false), true );
    25 BooleanTest( "true",               true,               true );
    26 BooleanTest( "false",              false,              false );
    28 test();
    30 function BooleanTest( string, object, expect ) {
    31   if ( object ) {
    32     result = true;
    33   } else {
    34     result = false;
    35   }
    37   new TestCase(
    38     SECTION,
    39     string,
    40     expect,
    41     result );
    42 }

mercurial