From 035e79610d995aef4bcc3fbcf59b9998d7c1459d Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Mon, 23 Oct 2017 21:56:00 -0700 Subject: [PATCH] switch small values to 0b notation --- .../bitwise-and/bigint-non-primitive.js | 18 +++++------ .../expressions/bitwise-and/bigint.js | 30 +++++++++---------- .../bitwise-or/bigint-non-primitive.js | 18 +++++------ .../language/expressions/bitwise-or/bigint.js | 30 +++++++++---------- .../bitwise-xor/bigint-non-primitive.js | 18 +++++------ .../expressions/bitwise-xor/bigint.js | 30 +++++++++---------- 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/test/language/expressions/bitwise-and/bigint-non-primitive.js b/test/language/expressions/bitwise-and/bigint-non-primitive.js index 1fffb066357..3079500b198 100644 --- a/test/language/expressions/bitwise-and/bigint-non-primitive.js +++ b/test/language/expressions/bitwise-and/bigint-non-primitive.js @@ -15,29 +15,29 @@ info: | features: [BigInt] ---*/ -assert.sameValue(Object(5n) & 3n, 1n, "Object(5n) & 3n === 1n"); -assert.sameValue(3n & Object(5n), 1n, "3n & Object(5n) === 1n"); -assert.sameValue(Object(5n) & Object(3n), 1n, "Object(5n) & Object(3n) === 1n"); +assert.sameValue(Object(0b101n) & 0b011n, 0b001n, "Object(0b101n) & 0b011n === 0b001n"); +assert.sameValue(0b011n & Object(0b101n), 0b001n, "0b011n & Object(0b101n) === 0b001n"); +assert.sameValue(Object(0b101n) & Object(0b011n), 0b001n, "Object(0b101n) & Object(0b011n) === 0b001n"); function err() { throw new Test262Error(); } assert.sameValue( - {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err} & 3n, 1n, + {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err} & 0b011n, 0b001n, "primitive from @@toPrimitive"); assert.sameValue( - 3n & {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err}, 1n, + 0b011n & {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err}, 0b001n, "primitive from @@toPrimitive"); assert.sameValue( - {valueOf: function() { return 5n; }, toString: err} & 3n, 1n, + {valueOf: function() { return 0b101n; }, toString: err} & 0b011n, 0b001n, "primitive from {}.valueOf"); assert.sameValue( - 3n & {valueOf: function() { return 5n; }, toString: err}, 1n, + 0b011n & {valueOf: function() { return 0b101n; }, toString: err}, 0b001n, "primitive from {}.valueOf"); assert.sameValue( - {toString: function() { return 5n; }} & 3n, 1n, + {toString: function() { return 0b101n; }} & 0b011n, 0b001n, "primitive from {}.toString"); assert.sameValue( - 3n & {toString: function() { return 5n; }}, 1n, + 0b011n & {toString: function() { return 0b101n; }}, 0b001n, "primitive from {}.toString"); diff --git a/test/language/expressions/bitwise-and/bigint.js b/test/language/expressions/bitwise-and/bigint.js index b9de1bebdc3..4f6eee641fd 100644 --- a/test/language/expressions/bitwise-and/bigint.js +++ b/test/language/expressions/bitwise-and/bigint.js @@ -23,21 +23,21 @@ info: | features: [BigInt] ---*/ -assert.sameValue(0n & 0n, 0n, "0n & 0n === 0n"); -assert.sameValue(0n & 1n, 0n, "0n & 1n === 0n"); -assert.sameValue(1n & 0n, 0n, "1n & 0n === 0n"); -assert.sameValue(0n & 2n, 0n, "0n & 2n === 0n"); -assert.sameValue(2n & 0n, 0n, "2n & 0n === 0n"); -assert.sameValue(0n & 3n, 0n, "0n & 3n === 0n"); -assert.sameValue(3n & 0n, 0n, "3n & 0n === 0n"); -assert.sameValue(1n & 1n, 1n, "1n & 1n === 1n"); -assert.sameValue(1n & 2n, 0n, "1n & 2n === 0n"); -assert.sameValue(2n & 1n, 0n, "2n & 1n === 0n"); -assert.sameValue(1n & 3n, 1n, "1n & 3n === 1n"); -assert.sameValue(3n & 1n, 1n, "3n & 1n === 1n"); -assert.sameValue(2n & 2n, 2n, "2n & 2n === 2n"); -assert.sameValue(2n & 3n, 2n, "2n & 3n === 2n"); -assert.sameValue(3n & 2n, 2n, "3n & 2n === 2n"); +assert.sameValue(0b00n & 0b00n, 0b00n, "0b00n & 0b00n === 0b00n"); +assert.sameValue(0b00n & 0b01n, 0b00n, "0b00n & 0b01n === 0b00n"); +assert.sameValue(0b01n & 0b00n, 0b00n, "0b01n & 0b00n === 0b00n"); +assert.sameValue(0b00n & 0b10n, 0b00n, "0b00n & 0b10n === 0b00n"); +assert.sameValue(0b10n & 0b00n, 0b00n, "0b10n & 0b00n === 0b00n"); +assert.sameValue(0b00n & 0b11n, 0b00n, "0b00n & 0b11n === 0b00n"); +assert.sameValue(0b11n & 0b00n, 0b00n, "0b11n & 0b00n === 0b00n"); +assert.sameValue(0b01n & 0b01n, 0b01n, "0b01n & 0b01n === 0b01n"); +assert.sameValue(0b01n & 0b10n, 0b00n, "0b01n & 0b10n === 0b00n"); +assert.sameValue(0b10n & 0b01n, 0b00n, "0b10n & 0b01n === 0b00n"); +assert.sameValue(0b01n & 0b11n, 0b01n, "0b01n & 0b11n === 0b01n"); +assert.sameValue(0b11n & 0b01n, 0b01n, "0b11n & 0b01n === 0b01n"); +assert.sameValue(0b10n & 0b10n, 0b10n, "0b10n & 0b10n === 0b10n"); +assert.sameValue(0b10n & 0b11n, 0b10n, "0b10n & 0b11n === 0b10n"); +assert.sameValue(0b11n & 0b10n, 0b10n, "0b11n & 0b10n === 0b10n"); assert.sameValue(0xffffffffn & 0n, 0n, "0xffffffffn & 0n === 0n"); assert.sameValue(0n & 0xffffffffn, 0n, "0n & 0xffffffffn === 0n"); assert.sameValue(0xffffffffn & 0xffffffffn, 0xffffffffn, "0xffffffffn & 0xffffffffn === 0xffffffffn"); diff --git a/test/language/expressions/bitwise-or/bigint-non-primitive.js b/test/language/expressions/bitwise-or/bigint-non-primitive.js index c40138590b6..66a78bc52b0 100644 --- a/test/language/expressions/bitwise-or/bigint-non-primitive.js +++ b/test/language/expressions/bitwise-or/bigint-non-primitive.js @@ -16,29 +16,29 @@ info: | features: [BigInt] ---*/ -assert.sameValue(Object(5n) | 3n, 7n, "Object(5n) | 3n === 7n"); -assert.sameValue(3n | Object(5n), 7n, "3n | Object(5n) === 7n"); -assert.sameValue(Object(5n) | Object(3n), 7n, "Object(5n) | Object(3n) === 7n"); +assert.sameValue(Object(0b101n) | 0b011n, 0b111n, "Object(0b101n) | 0b011n === 0b111n"); +assert.sameValue(0b011n | Object(0b101n), 0b111n, "0b011n | Object(0b101n) === 0b111n"); +assert.sameValue(Object(0b101n) | Object(0b011n), 0b111n, "Object(0b101n) | Object(0b011n) === 0b111n"); function err() { throw new Test262Error(); } assert.sameValue( - {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err} | 3n, 7n, + {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err} | 0b011n, 0b111n, "primitive from @@toPrimitive"); assert.sameValue( - 3n | {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err}, 7n, + 0b011n | {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err}, 0b111n, "primitive from @@toPrimitive"); assert.sameValue( - {valueOf: function() { return 5n; }, toString: err} | 3n, 7n, + {valueOf: function() { return 0b101n; }, toString: err} | 0b011n, 0b111n, "primitive from {}.valueOf"); assert.sameValue( - 3n | {valueOf: function() { return 5n; }, toString: err}, 7n, + 0b011n | {valueOf: function() { return 0b101n; }, toString: err}, 0b111n, "primitive from {}.valueOf"); assert.sameValue( - {toString: function() { return 5n; }} | 3n, 7n, + {toString: function() { return 0b101n; }} | 0b011n, 0b111n, "primitive from {}.toString"); assert.sameValue( - 3n | {toString: function() { return 5n; }}, 7n, + 0b011n | {toString: function() { return 0b101n; }}, 0b111n, "primitive from {}.toString"); diff --git a/test/language/expressions/bitwise-or/bigint.js b/test/language/expressions/bitwise-or/bigint.js index 81cdd9caced..51aef99401f 100644 --- a/test/language/expressions/bitwise-or/bigint.js +++ b/test/language/expressions/bitwise-or/bigint.js @@ -23,21 +23,21 @@ info: | features: [BigInt] ---*/ -assert.sameValue(0n | 0n, 0n, "0n | 0n === 0n"); -assert.sameValue(0n | 1n, 1n, "0n | 1n === 1n"); -assert.sameValue(1n | 0n, 1n, "1n | 0n === 1n"); -assert.sameValue(0n | 2n, 2n, "0n | 2n === 2n"); -assert.sameValue(2n | 0n, 2n, "2n | 0n === 2n"); -assert.sameValue(0n | 3n, 3n, "0n | 3n === 3n"); -assert.sameValue(3n | 0n, 3n, "3n | 0n === 3n"); -assert.sameValue(1n | 1n, 1n, "1n | 1n === 1n"); -assert.sameValue(1n | 2n, 3n, "1n | 2n === 3n"); -assert.sameValue(2n | 1n, 3n, "2n | 1n === 3n"); -assert.sameValue(1n | 3n, 3n, "1n | 3n === 3n"); -assert.sameValue(3n | 1n, 3n, "3n | 1n === 3n"); -assert.sameValue(2n | 2n, 2n, "2n | 2n === 2n"); -assert.sameValue(2n | 3n, 3n, "2n | 3n === 3n"); -assert.sameValue(3n | 2n, 3n, "3n | 2n === 3n"); +assert.sameValue(0b00n | 0b00n, 0b00n, "0b00n | 0b00n === 0b00n"); +assert.sameValue(0b00n | 0b01n, 0b01n, "0b00n | 0b01n === 0b01n"); +assert.sameValue(0b01n | 0b00n, 0b01n, "0b01n | 0b00n === 0b01n"); +assert.sameValue(0b00n | 0b10n, 0b10n, "0b00n | 0b10n === 0b10n"); +assert.sameValue(0b10n | 0b00n, 0b10n, "0b10n | 0b00n === 0b10n"); +assert.sameValue(0b00n | 0b11n, 0b11n, "0b00n | 0b11n === 0b11n"); +assert.sameValue(0b11n | 0b00n, 0b11n, "0b11n | 0b00n === 0b11n"); +assert.sameValue(0b01n | 0b01n, 0b01n, "0b01n | 0b01n === 0b01n"); +assert.sameValue(0b01n | 0b10n, 0b11n, "0b01n | 0b10n === 0b11n"); +assert.sameValue(0b10n | 0b01n, 0b11n, "0b10n | 0b01n === 0b11n"); +assert.sameValue(0b01n | 0b11n, 0b11n, "0b01n | 0b11n === 0b11n"); +assert.sameValue(0b11n | 0b01n, 0b11n, "0b11n | 0b01n === 0b11n"); +assert.sameValue(0b10n | 0b10n, 0b10n, "0b10n | 0b10n === 0b10n"); +assert.sameValue(0b10n | 0b11n, 0b11n, "0b10n | 0b11n === 0b11n"); +assert.sameValue(0b11n | 0b10n, 0b11n, "0b11n | 0b10n === 0b11n"); assert.sameValue(0xffffffffn | 0n, 0xffffffffn, "0xffffffffn | 0n === 0xffffffffn"); assert.sameValue(0n | 0xffffffffn, 0xffffffffn, "0n | 0xffffffffn === 0xffffffffn"); assert.sameValue(0xffffffffn | 0xffffffffn, 0xffffffffn, "0xffffffffn | 0xffffffffn === 0xffffffffn"); diff --git a/test/language/expressions/bitwise-xor/bigint-non-primitive.js b/test/language/expressions/bitwise-xor/bigint-non-primitive.js index 2bde84dbe5b..c8558c930e7 100644 --- a/test/language/expressions/bitwise-xor/bigint-non-primitive.js +++ b/test/language/expressions/bitwise-xor/bigint-non-primitive.js @@ -16,29 +16,29 @@ info: | features: [BigInt] ---*/ -assert.sameValue(Object(5n) ^ 3n, 6n, "Object(5n) ^ 3n === 6n"); -assert.sameValue(3n ^ Object(5n), 6n, "3n ^ Object(5n) === 6n"); -assert.sameValue(Object(5n) ^ Object(3n), 6n, "Object(5n) ^ Object(3n) === 6n"); +assert.sameValue(Object(0b101n) ^ 0b011n, 0b110n, "Object(0b101n) ^ 0b011n === 0b110n"); +assert.sameValue(0b011n ^ Object(0b101n), 0b110n, "0b011n ^ Object(0b101n) === 0b110n"); +assert.sameValue(Object(0b101n) ^ Object(0b011n), 0b110n, "Object(0b101n) ^ Object(0b011n) === 0b110n"); function err() { throw new Test262Error(); } assert.sameValue( - {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err} ^ 3n, 6n, + {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err} ^ 0b011n, 0b110n, "primitive from @@toPrimitive"); assert.sameValue( - 3n ^ {[Symbol.toPrimitive]: function() { return 5n; }, valueOf: err, toString: err}, 6n, + 0b011n ^ {[Symbol.toPrimitive]: function() { return 0b101n; }, valueOf: err, toString: err}, 0b110n, "primitive from @@toPrimitive"); assert.sameValue( - {valueOf: function() { return 5n; }, toString: err} ^ 3n, 6n, + {valueOf: function() { return 0b101n; }, toString: err} ^ 0b011n, 0b110n, "primitive from {}.valueOf"); assert.sameValue( - 3n ^ {valueOf: function() { return 5n; }, toString: err}, 6n, + 0b011n ^ {valueOf: function() { return 0b101n; }, toString: err}, 0b110n, "primitive from {}.valueOf"); assert.sameValue( - {toString: function() { return 5n; }} ^ 3n, 6n, + {toString: function() { return 0b101n; }} ^ 0b011n, 0b110n, "primitive from {}.toString"); assert.sameValue( - 3n ^ {toString: function() { return 5n; }}, 6n, + 0b011n ^ {toString: function() { return 0b101n; }}, 0b110n, "primitive from {}.toString"); diff --git a/test/language/expressions/bitwise-xor/bigint.js b/test/language/expressions/bitwise-xor/bigint.js index 867d54523ce..d7679022eb6 100644 --- a/test/language/expressions/bitwise-xor/bigint.js +++ b/test/language/expressions/bitwise-xor/bigint.js @@ -23,21 +23,21 @@ info: | features: [BigInt] ---*/ -assert.sameValue(0n ^ 0n, 0n, "0n ^ 0n === 0n"); -assert.sameValue(0n ^ 1n, 1n, "0n ^ 1n === 1n"); -assert.sameValue(1n ^ 0n, 1n, "1n ^ 0n === 1n"); -assert.sameValue(0n ^ 2n, 2n, "0n ^ 2n === 2n"); -assert.sameValue(2n ^ 0n, 2n, "2n ^ 0n === 2n"); -assert.sameValue(0n ^ 3n, 3n, "0n ^ 3n === 3n"); -assert.sameValue(3n ^ 0n, 3n, "3n ^ 0n === 3n"); -assert.sameValue(1n ^ 1n, 0n, "1n ^ 1n === 0n"); -assert.sameValue(1n ^ 2n, 3n, "1n ^ 2n === 3n"); -assert.sameValue(2n ^ 1n, 3n, "2n ^ 1n === 3n"); -assert.sameValue(1n ^ 3n, 2n, "1n ^ 3n === 2n"); -assert.sameValue(3n ^ 1n, 2n, "3n ^ 1n === 2n"); -assert.sameValue(2n ^ 2n, 0n, "2n ^ 2n === 0n"); -assert.sameValue(2n ^ 3n, 1n, "2n ^ 3n === 1n"); -assert.sameValue(3n ^ 2n, 1n, "3n ^ 2n === 1n"); +assert.sameValue(0b00n ^ 0b00n, 0b00n, "0b00n ^ 0b00n === 0b00n"); +assert.sameValue(0b00n ^ 0b01n, 0b01n, "0b00n ^ 0b01n === 0b01n"); +assert.sameValue(0b01n ^ 0b00n, 0b01n, "0b01n ^ 0b00n === 0b01n"); +assert.sameValue(0b00n ^ 0b10n, 0b10n, "0b00n ^ 0b10n === 0b10n"); +assert.sameValue(0b10n ^ 0b00n, 0b10n, "0b10n ^ 0b00n === 0b10n"); +assert.sameValue(0b00n ^ 0b11n, 0b11n, "0b00n ^ 0b11n === 0b11n"); +assert.sameValue(0b11n ^ 0b00n, 0b11n, "0b11n ^ 0b00n === 0b11n"); +assert.sameValue(0b01n ^ 0b01n, 0b00n, "0b01n ^ 0b01n === 0b00n"); +assert.sameValue(0b01n ^ 0b10n, 0b11n, "0b01n ^ 0b10n === 0b11n"); +assert.sameValue(0b10n ^ 0b01n, 0b11n, "0b10n ^ 0b01n === 0b11n"); +assert.sameValue(0b01n ^ 0b11n, 0b10n, "0b01n ^ 0b11n === 0b10n"); +assert.sameValue(0b11n ^ 0b01n, 0b10n, "0b11n ^ 0b01n === 0b10n"); +assert.sameValue(0b10n ^ 0b10n, 0b00n, "0b10n ^ 0b10n === 0b00n"); +assert.sameValue(0b10n ^ 0b11n, 0b01n, "0b10n ^ 0b11n === 0b01n"); +assert.sameValue(0b11n ^ 0b10n, 0b01n, "0b11n ^ 0b10n === 0b01n"); assert.sameValue(0xffffffffn ^ 0n, 0xffffffffn, "0xffffffffn ^ 0n === 0xffffffffn"); assert.sameValue(0n ^ 0xffffffffn, 0xffffffffn, "0n ^ 0xffffffffn === 0xffffffffn"); assert.sameValue(0xffffffffn ^ 0xffffffffn, 0n, "0xffffffffn ^ 0xffffffffn === 0n");