js/src/tests/test262/ch08/8.4/S8.4_A8.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  * Empty string, 0, false are all equal (==) to each other, since they all evaluate to 0
     6  *
     7  * @path ch08/8.4/S8.4_A8.js
     8  * @description Compare empty string with undefined, null, 0 and false
     9  */
    11 var str='';
    13 ////////////////////////////////////////////////////////////
    14 // CHECK#1
    15 if (str == undefined){
    16   $ERROR('#1: Empty string and undefined are not equal (!=) to each other');
    17 }
    18 //
    19 /////////////////////////////////////////////////////////////
    21 ////////////////////////////////////////////////////////////
    22 // CHECK#2
    23 if (str == null){
    24   $ERROR('#1: Empty string and Null are not equal (!=) to each other');
    25 }
    26 //
    27 /////////////////////////////////////////////////////////////
    29 ////////////////////////////////////////////////////////////
    30 // CHECK#3
    31 if (str != 0){
    32   $ERROR('#3: Empty string and 0 are equal (==) to each other, since they all evaluate to 0');
    33 }
    34 //
    35 /////////////////////////////////////////////////////////////
    37 ////////////////////////////////////////////////////////////
    38 // CHECK#4
    39 if (str != false){
    40   $ERROR('#4: Empty string and false are equal (==) to each other, since they all evaluate to 0');
    41 }
    42 //
    43 /////////////////////////////////////////////////////////////

mercurial