| 1 |
// Copyright (C) 2017 Josh Wolfe. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: Strict inequality comparison of BigInt values and non-primitive objects |
| 6 |
esid: sec-strict-equality-comparison |
| 7 |
info: | |
| 8 |
1. If Type(x) is different from Type(y), return false. |
| 9 |
|
| 10 |
features: [BigInt] |
| 11 |
---*/ |
| 12 |
|
| 13 |
assert.sameValue(0n !== Object(0n), true, "0n !== Object(0n)"); |
| 14 |
assert.sameValue(Object(0n) !== 0n, true, "Object(0n) !== 0n"); |
| 15 |
assert.sameValue(0n !== Object(1n), true, "0n !== Object(1n)"); |
| 16 |
assert.sameValue(Object(1n) !== 0n, true, "Object(1n) !== 0n"); |
| 17 |
assert.sameValue(1n !== Object(0n), true, "1n !== Object(0n)"); |
| 18 |
assert.sameValue(Object(0n) !== 1n, true, "Object(0n) !== 1n"); |
| 19 |
assert.sameValue(1n !== Object(1n), true, "1n !== Object(1n)"); |
| 20 |
assert.sameValue(Object(1n) !== 1n, true, "Object(1n) !== 1n"); |
| 21 |
assert.sameValue(2n !== Object(0n), true, "2n !== Object(0n)"); |
| 22 |
assert.sameValue(Object(0n) !== 2n, true, "Object(0n) !== 2n"); |
| 23 |
assert.sameValue(2n !== Object(1n), true, "2n !== Object(1n)"); |
| 24 |
assert.sameValue(Object(1n) !== 2n, true, "Object(1n) !== 2n"); |
| 25 |
assert.sameValue(2n !== Object(2n), true, "2n !== Object(2n)"); |
| 26 |
assert.sameValue(Object(2n) !== 2n, true, "Object(2n) !== 2n"); |
| 27 |
assert.sameValue(0n !== {}, true, "0n !== {}"); |
| 28 |
assert.sameValue({} !== 0n, true, "{} !== 0n"); |
| 29 |
assert.sameValue(0n !== {valueOf: function() { return 0n; }}, true, "0n !== {valueOf: function() { return 0n; }}"); |
| 30 |
assert.sameValue({valueOf: function() { return 0n; }} !== 0n, true, "{valueOf: function() { return 0n; }} !== 0n"); |
| 31 |
assert.sameValue(0n !== {valueOf: function() { return 1n; }}, true, "0n !== {valueOf: function() { return 1n; }}"); |
| 32 |
assert.sameValue({valueOf: function() { return 1n; }} !== 0n, true, "{valueOf: function() { return 1n; }} !== 0n"); |
| 33 |
assert.sameValue(0n !== {toString: function() { return "0"; }}, true, '0n !== {toString: function() { return "0"; }}'); |
| 34 |
assert.sameValue({toString: function() { return "0"; }} !== 0n, true, '{toString: function() { return "0"; }} !== 0n'); |
| 35 |
assert.sameValue(0n !== {toString: function() { return "1"; }}, true, '0n !== {toString: function() { return "1"; }}'); |
| 36 |
assert.sameValue({toString: function() { return "1"; }} !== 0n, true, '{toString: function() { return "1"; }} !== 0n'); |
| 37 |
assert.sameValue(900719925474099101n !== {valueOf: function() { return 900719925474099101n; }}, true, "900719925474099101n !== {valueOf: function() { return 900719925474099101n; }}"); |
| 38 |
assert.sameValue({valueOf: function() { return 900719925474099101n; }} !== 900719925474099101n, true, "{valueOf: function() { return 900719925474099101n; }} !== 900719925474099101n"); |
| 39 |
assert.sameValue(900719925474099101n !== {valueOf: function() { return 900719925474099102n; }}, true, "900719925474099101n !== {valueOf: function() { return 900719925474099102n; }}"); |
| 40 |
assert.sameValue({valueOf: function() { return 900719925474099102n; }} !== 900719925474099101n, true, "{valueOf: function() { return 900719925474099102n; }} !== 900719925474099101n"); |
| 41 |
assert.sameValue(900719925474099101n !== {toString: function() { return "900719925474099101"; }}, true, '900719925474099101n !== {toString: function() { return "900719925474099101"; }}'); |
| 42 |
assert.sameValue({toString: function() { return "900719925474099101"; }} !== 900719925474099101n, true, '{toString: function() { return "900719925474099101"; }} !== 900719925474099101n'); |
| 43 |
assert.sameValue(900719925474099101n !== {toString: function() { return "900719925474099102"; }}, true, '900719925474099101n !== {toString: function() { return "900719925474099102"; }}'); |
| 44 |
assert.sameValue({toString: function() { return "900719925474099102"; }} !== 900719925474099101n, true, '{toString: function() { return "900719925474099102"; }} !== 900719925474099101n'); |