| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
Type(x) and Type(y) are Object-s. |
| 7 |
Return true, if x and y are references to the same Object; otherwise, return false |
| 8 |
es5id: 11.9.2_A7.1 |
| 9 |
description: > |
| 10 |
Checking Boolean object, Number object, String object, Object |
| 11 |
object |
| 12 |
---*/ |
| 13 |
|
| 14 |
//CHECK#1 |
| 15 |
if ((new Boolean(true) != new Boolean(true)) !== true) { |
| 16 |
$ERROR('#1: (new Boolean(true) != new Boolean(true)) === true'); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK#2 |
| 20 |
if ((new Number(1) != new Number(1)) !== true) { |
| 21 |
$ERROR('#2: (new Number(1) != new Number(1)) === true'); |
| 22 |
} |
| 23 |
|
| 24 |
//CHECK#3 |
| 25 |
if ((new String("x") != new String("x")) !== true) { |
| 26 |
$ERROR('#3: (new String("x") != new String("x")) === true'); |
| 27 |
} |
| 28 |
|
| 29 |
//CHECK#4 |
| 30 |
if ((new Object() != new Object()) !== true) { |
| 31 |
$ERROR('#4: (new Object() != new Object()) === true'); |
| 32 |
} |
| 33 |
|
| 34 |
//CHECK#5 |
| 35 |
var x, y; |
| 36 |
x = {}; |
| 37 |
y = x; |
| 38 |
if ((x != y) !== false) { |
| 39 |
$ERROR('#5: x = {}; y = x; (x != y) === false'); |
| 40 |
} |
| 41 |
|
| 42 |
//CHECK#6 |
| 43 |
if ((new Boolean(true) != new Number(1)) !== true) { |
| 44 |
$ERROR('#6 (new Boolean(true) != new Number(1)) === true'); |
| 45 |
} |
| 46 |
|
| 47 |
//CHECK#7 |
| 48 |
if ((new Number(1) != new String("1")) !== true) { |
| 49 |
$ERROR('#7: (new Number(1) != new String("1")) === true'); |
| 50 |
} |
| 51 |
|
| 52 |
//CHECK#8 |
| 53 |
if ((new String("1") != new Boolean(true)) !== true) { |
| 54 |
$ERROR('#8: (new String("x") != new Boolean(true)) === true'); |
| 55 |
} |