Wed, 31 Dec 2014 13:27:57 +0100
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 * Assignment to string literals calls String constructor
6 *
7 * @path ch08/8.4/S8.4_A9_T2.js
8 * @description Compare empty string variable, object String('') and object String()
9 */
11 var str="";
12 var strObj=new String("");
13 var strObj_=new String();
15 ////////////////////////////////////////////////////////////
16 // CHECK#1
17 if (str.constructor !== strObj.constructor){
18 $ERROR('#1: "".constructor === new String("").constructor');
19 }
20 //
21 /////////////////////////////////////////////////////////////
23 ////////////////////////////////////////////////////////////
24 // CHECK#2
25 if (str.constructor !== strObj_.constructor){
26 $ERROR('#2: "".constructor === new String().constructor');
27 }
28 //
29 /////////////////////////////////////////////////////////////
31 ////////////////////////////////////////////////////////////
32 // CHECK#3
33 if (str != strObj){
34 $ERROR('#3: values of str=""; and strObj=new String(""); are equal');
35 }
36 //
37 /////////////////////////////////////////////////////////////
39 ////////////////////////////////////////////////////////////
40 // CHECK#4
41 if (str === strObj){
42 $ERROR('#4: objects of str=""; and strObj=new String(""); are different');
43 }
44 //
45 /////////////////////////////////////////////////////////////
47 ////////////////////////////////////////////////////////////
48 // CHECK#5
49 if (str != strObj_){
50 $ERROR('#5: values of str=""; and strObj=new String(); are equal');
51 }
52 //
53 /////////////////////////////////////////////////////////////
55 ////////////////////////////////////////////////////////////
56 // CHECK#6
57 if (str === strObj_){
58 $ERROR('#6: objects of str=""; and strObj=new String(); are different');
59 }
60 //
61 /////////////////////////////////////////////////////////////