1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_2/version120/boolean-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +// |reftest| skip -- obsolete test 1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 + 1.11 +/** 1.12 + * File Name: boolean-001.js 1.13 + * Description: 1.14 + * 1.15 + * In JavaScript 1.2, new Boolean(false) evaluates to false. 1.16 + * 1.17 + * Author: christine@netscape.com 1.18 + * Date: 11 August 1998 1.19 + */ 1.20 +var SECTION = "boolean-001.js"; 1.21 +var VERSION = "JS1_2"; 1.22 +startTest(); 1.23 +var TITLE = "new Boolean(false) should evaluate to false"; 1.24 + 1.25 +writeHeaderToLog( SECTION + " "+ TITLE); 1.26 + 1.27 +BooleanTest( "new Boolean(true)", new Boolean(true), true ); 1.28 +BooleanTest( "new Boolean(false)", new Boolean(false), false ); 1.29 +BooleanTest( "true", true, true ); 1.30 +BooleanTest( "false", false, false ); 1.31 + 1.32 +test(); 1.33 + 1.34 +function BooleanTest( string, object, expect ) { 1.35 + if ( object ) { 1.36 + result = true; 1.37 + } else { 1.38 + result = false; 1.39 + } 1.40 + 1.41 + new TestCase( 1.42 + SECTION, 1.43 + string, 1.44 + expect, 1.45 + result ); 1.46 +} 1.47 +