michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Assignment to string literals calls String constructor michael@0: * michael@0: * @path ch08/8.4/S8.4_A9_T3.js michael@0: * @description Simple empty string variable compare with empty object String michael@0: */ michael@0: michael@0: var str=""; michael@0: var strObj=new String; michael@0: michael@0: //////////////////////////////////////////////////////////// michael@0: // CHECK#1 michael@0: if (str.constructor !== strObj.constructor){ michael@0: $ERROR('#1: "".constructor === new String.constructor'); michael@0: } michael@0: // michael@0: ///////////////////////////////////////////////////////////// michael@0: michael@0: //////////////////////////////////////////////////////////// michael@0: // CHECK#2 michael@0: if (str != strObj){ michael@0: $ERROR('#2: values of str=""; and strObj=new String(""); are equal'); michael@0: } michael@0: // michael@0: ///////////////////////////////////////////////////////////// michael@0: michael@0: //////////////////////////////////////////////////////////// michael@0: // CHECK#3 michael@0: if (str === strObj){ michael@0: $ERROR('#3: objects of str=""; and strObj=new String(""); are different'); michael@0: } michael@0: // michael@0: ///////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: if (typeof str == typeof strObj){ michael@0: $ERROR('#4: types of str=""; and strObj=new String(""); are different'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: