Thu, 15 Jan 2015 15:55:04 +0100
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_T1.js
8 * @description Simple string variable compare with object String
9 */
11 var str='ABC';
12 var strObj=new String('ABC');
14 ////////////////////////////////////////////////////////////
15 // CHECK#1
16 if (str.constructor !== strObj.constructor){
17 $ERROR('#1: \'ABC\'.constructor === new String(\'ABC\').constructor');
18 }
19 //
20 /////////////////////////////////////////////////////////////
22 ////////////////////////////////////////////////////////////
23 // CHECK#2
24 if (str != strObj){
25 $ERROR('#2: "ABC" == new String("ABC")');
26 }
27 //
28 /////////////////////////////////////////////////////////////
30 ////////////////////////////////////////////////////////////
31 // CHECK#3
32 if (str === strObj){
33 $ERROR('#3: "ABC" !== new String("ABC")');
34 }
35 //
36 /////////////////////////////////////////////////////////////