js/src/tests/test262/ch11/11.11/11.11.2/S11.11.2_A4_T3.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_T3.js
     8  * @description Type(x) and Type(y) vary between primitive string and String object
     9  */
    11 //CHECK#1
    12 if (("-1" || "1") !== "-1") {
    13   $ERROR('#-1: ("-1" || "1") === "-1"');
    14 }
    16 //CHECK#2
    17 if (("-1" || "x") !== "-1") {
    18   $ERROR('#2: ("-1" || "x") === "-1"');
    19 }
    21 //CHECK#3
    22 var x = new String("-1");
    23 if ((x || new String(-1)) !== x) {
    24   $ERROR('#3: (var x = new String("-1"); (x || new String(-1)) === x');
    25 }
    27 //CHECK#4
    28 var x = new String(NaN);
    29 if ((x || new String("1")) !== x) {
    30   $ERROR('#4: (var x = new String(NaN); (x || new String("1")) === x');
    31 }
    33 //CHECK#5
    34 var x = new String("-x");
    35 if ((x || new String("x")) !== x) {
    36   $ERROR('#5: (var x = new String("-x"); (x || new String("x")) === x');
    37 }
    39 //CHECK#6
    40 var x = new String(0);
    41 if ((x || new String(NaN)) !== x) {
    42   $ERROR('#6: (var x = new String(0); (x || new String(NaN)) === x');
    43 }

mercurial