js/src/tests/test262/ch12/12.5/S12.5_A1.2_T1.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * 1, true, non-empty string and others in expression is evaluated to true when using operator "new"
     6  *
     7  * @path ch12/12.5/S12.5_A1.2_T1.js
     8  * @description Using "if" without "else" construction
     9  */
    11 //////////////////////////////////////////////////////////////////////////////
    12 //CHECK#1
    13 if(!(new Number(1)))
    14 	$ERROR('#1: new 1 in expression is evaluated to true');
    15 //
    16 //////////////////////////////////////////////////////////////////////////////
    18 //////////////////////////////////////////////////////////////////////////////
    19 //CHECK#2
    20 if(!(new Boolean(true)))
    21 	$ERROR('#2: new true in expression is evaluated to true');
    22 //
    23 //////////////////////////////////////////////////////////////////////////////
    25 //////////////////////////////////////////////////////////////////////////////
    26 //CHECK#3
    27 if(!(new String("1")))
    28 	$ERROR('#3: new "1" in expression is evaluated to true');
    29 //
    30 //////////////////////////////////////////////////////////////////////////////
    32 //////////////////////////////////////////////////////////////////////////////
    33 //CHECK#4
    34 if(!(new String("A")))
    35 	$ERROR('#4: new "A" in expression is evaluated to true');
    36 //
    37 //////////////////////////////////////////////////////////////////////////////
    39 //////////////////////////////////////////////////////////////////////////////
    40 //CHECK#5
    41 if(!(new Boolean(false)))
    42     $ERROR('#2: new false in expression is evaluated to true ');
    43 //
    44 //////////////////////////////////////////////////////////////////////////////
    46 //////////////////////////////////////////////////////////////////////////////
    47 //CHECK#6
    48 if(!(new Number(NaN)))
    49     $ERROR('#6: new NaN in expression is evaluated to true ');
    50 //
    51 //////////////////////////////////////////////////////////////////////////////
    53 //////////////////////////////////////////////////////////////////////////////
    54 //CHECK#7
    55 if(!(new Number(null)))
    56   $ERROR('#7: new null in expression is evaluated to true ');
    57 //
    58 //////////////////////////////////////////////////////////////////////////////
    60 //////////////////////////////////////////////////////////////////////////////
    61 //CHECK#8
    62 if(!(new String(undefined)))
    63   $ERROR('#8: new undefined in expression is evaluated to true ');
    64 //
    65 //////////////////////////////////////////////////////////////////////////////
    67 //////////////////////////////////////////////////////////////////////////////
    68 //CHECK#9
    69 if(!(new String("")))
    70     $ERROR('#9: new empty string in expression is evaluated to true ');
    71 //
    72 //////////////////////////////////////////////////////////////////////////////

mercurial