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: * Type(x) and Type(y) are Object-s. michael@0: * Return true, if x and y are references to the same Object; otherwise, return false michael@0: * michael@0: * @path ch11/11.9/11.9.1/S11.9.1_A7.1.js michael@0: * @description Checking Boolean object, Number object, String object, Object object michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: if ((new Boolean(true) == new Boolean(true)) !== false) { michael@0: $ERROR('#1: (new Boolean(true) == new Boolean(true)) === false'); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: if ((new Number(1) == new Number(1)) !== false) { michael@0: $ERROR('#2: (new Number(1) == new Number(1)) === false'); michael@0: } michael@0: michael@0: //CHECK#3 michael@0: if ((new String("x") == new String("x")) !== false) { michael@0: $ERROR('#3: (new String("x") == new String("x")) === false'); michael@0: } michael@0: michael@0: //CHECK#4 michael@0: if ((new Object() == new Object()) !== false) { michael@0: $ERROR('#4: (new Object() == new Object()) === false'); michael@0: } michael@0: michael@0: //CHECK#5 michael@0: x = {}; michael@0: y = x; michael@0: if ((x == y) !== true) { michael@0: $ERROR('#5: x = {}; y = x; (x == y) === true'); michael@0: } michael@0: michael@0: //CHECK#6 michael@0: if ((new Boolean(true) == new Number(1)) !== false) { michael@0: $ERROR('#6 (new Boolean(true) == new Number(1)) === false'); michael@0: } michael@0: michael@0: //CHECK#7 michael@0: if ((new Number(1) == new String("1")) !== false) { michael@0: $ERROR('#7: (new Number(1) == new String("1")) === false'); michael@0: } michael@0: michael@0: //CHECK#8 michael@0: if ((new String("1") == new Boolean(true)) !== false) { michael@0: $ERROR('#8: (new String("x") == new Boolean(true)) === false'); michael@0: } michael@0: