js/src/tests/test262/ch08/8.4/S8.4_A9_T3.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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  * Assignment to string literals calls String constructor
     6  *
     7  * @path ch08/8.4/S8.4_A9_T3.js
     8  * @description Simple empty string variable compare with empty object String
     9  */
    11 var str="";
    12 var strObj=new String;
    14 ////////////////////////////////////////////////////////////
    15 // CHECK#1
    16 if (str.constructor !== strObj.constructor){
    17   $ERROR('#1: "".constructor === new String.constructor');
    18 }
    19 //
    20 /////////////////////////////////////////////////////////////
    22 ////////////////////////////////////////////////////////////
    23 // CHECK#2
    24 if (str != strObj){
    25   $ERROR('#2: values of str=""; and strObj=new String(""); are equal');
    26 }
    27 //
    28 /////////////////////////////////////////////////////////////
    30 ////////////////////////////////////////////////////////////
    31 // CHECK#3
    32 if (str === strObj){
    33   $ERROR('#3: objects of str=""; and strObj=new String(""); are different');
    34 }
    35 //
    36 /////////////////////////////////////////////////////////////
    38 //////////////////////////////////////////////////////////////////////////////
    39 //CHECK#4
    40 if (typeof str == typeof strObj){
    41   $ERROR('#4: types of str=""; and strObj=new String(""); are different');
    42 }
    43 //
    44 //////////////////////////////////////////////////////////////////////////////

mercurial