js/src/tests/test262/ch11/11.11/11.11.2/S11.11.2_A4_T2.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     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  * If ToBoolean(x) is true, return x
     6  *
     7  * @path ch11/11.11/11.11.2/S11.11.2_A4_T2.js
     8  * @description Type(x) and Type(y) vary between primitive number and Number object
     9  */
    11 //CHECK#1
    12 if ((-1 || 1) !== -1) {
    13   $ERROR('#1: (-1 || 1) === -1');
    14 }
    16 //CHECK#2
    17 if ((1 || new Number(0)) !== 1) {
    18   $ERROR('#2: (1 || new Number(0)) === 1');
    19 } 
    21 //CHECK#3
    22 if ((-1 || NaN) !== -1) {
    23   $ERROR('#3: (-1 || NaN) === -1');
    24 }
    26 //CHECK#4
    27 var x = new Number(-1);
    28 if ((x || new Number(0)) !== x) {
    29   $ERROR('#4: (var x = new Number(-1); (x || new Number(-1)) === x');
    30 }
    32 //CHECK#5
    33 var x = new Number(NaN);
    34 if ((x || new Number(1)) !== x) {
    35   $ERROR('#5: (var x = new Number(NaN); (x || new Number(1)) === x');
    36 }
    38 //CHECK#6
    39 var x = new Number(0);
    40 if ((x || new Number(NaN)) !== x) {
    41   $ERROR('#6: (var x = new Number(0); (x || new Number(NaN)) === x');
    42 }

mercurial