diff options
Diffstat (limited to 'test/built-ins/DataView/prototype')
44 files changed, 416 insertions, 466 deletions
diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js index 2e493d64e..163513c77 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js @@ -30,7 +30,7 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(RangeError, () => sample.getBigInt64(Infinity), - "DataView access at index Infinity should throw"); + "DataView access at index Infinity should throw"); assert.throws(RangeError, () => sample.getBigInt64(-1), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js index b25d05470..e2aae6435 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js @@ -32,4 +32,4 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigInt64(13), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js index 53fd563ae..ed1b5a8c6 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js @@ -27,4 +27,4 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigInt64(0), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js index 517265314..57e75e8e9 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js +++ b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js @@ -30,7 +30,7 @@ var buffer = new ArrayBuffer(12); sample = new DataView(buffer, 0); assert.throws(RangeError, () => sample.getBigInt64(Infinity), - "DataView access at index Infinity should throw"); + "DataView access at index Infinity should throw"); assert.throws(RangeError, () => sample.getBigInt64(13), "13 + 8 > 12"); @@ -52,24 +52,24 @@ assert.throws(RangeError, () => sample.getBigInt64(5), "5 + 8 > 12"); sample = new DataView(buffer, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 4 (offset)"); + "1 + 8 > 4 (offset)"); sample = new DataView(buffer, 9); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 3 (offset)"); + "0 + 8 > 3 (offset)"); sample = new DataView(buffer, 0, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 8 (length)"); + "1 + 8 > 8 (length)"); sample = new DataView(buffer, 0, 7); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 7 (length)"); + "0 + 8 > 7 (length)"); sample = new DataView(buffer, 4, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 8 (offset+length)"); + "1 + 8 > 8 (offset+length)"); sample = new DataView(buffer, 4, 7); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 7 (offset+length)"); + "0 + 8 > 7 (offset+length)"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js index 2b17f822b..eb466a69d 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js +++ b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js @@ -24,7 +24,7 @@ var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); assert.throws(RangeError, () => sample.getBigInt64(-1), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); assert.throws(RangeError, () => sample.getBigInt64(-Infinity), - "DataView access at index -Infinity should throw"); + "DataView access at index -Infinity should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js index 6e71746c8..51a723d82 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js @@ -23,16 +23,8 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { - valueOf() { - throw new Test262Error(); - } -}; -var bo2 = { - toString() { - throw new Test262Error(); - } -}; +var bo1 = { valueOf() { throw new Test262Error(); } }; +var bo2 = { toString() { throw new Test262Error(); } }; assert.throws(Test262Error, () => sample.getBigInt64(bo1), "valueOf"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js b/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js index 14e27dad6..ceb131104 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js +++ b/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js @@ -36,13 +36,13 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); -assert.sameValue(sample.getBigInt64(0, true), 0 n, "sample.getBigInt64(0, true)"); -assert.sameValue(sample.getBigInt64(1, true), 0 n, "sample.getBigInt64(1, true)"); -assert.sameValue(sample.getBigInt64(2, true), 0 n, "sample.getBigInt64(2, true)"); -assert.sameValue(sample.getBigInt64(3, true), 0 n, "sample.getBigInt64(3, true)"); -assert.sameValue(sample.getBigInt64(4, true), 0 n, "sample.getBigInt64(4, true)"); -assert.sameValue(sample.getBigInt64(0, false), 0 n, "sample.getBigInt64(0, false)"); -assert.sameValue(sample.getBigInt64(1, false), 0 n, "sample.getBigInt64(1, false)"); -assert.sameValue(sample.getBigInt64(2, false), 0 n, "sample.getBigInt64(2, false)"); -assert.sameValue(sample.getBigInt64(3, false), 0 n, "sample.getBigInt64(3, false)"); -assert.sameValue(sample.getBigInt64(4, false), 0 n, "sample.getBigInt64(4, false)"); +assert.sameValue(sample.getBigInt64(0, true), 0n, "sample.getBigInt64(0, true)"); +assert.sameValue(sample.getBigInt64(1, true), 0n, "sample.getBigInt64(1, true)"); +assert.sameValue(sample.getBigInt64(2, true), 0n, "sample.getBigInt64(2, true)"); +assert.sameValue(sample.getBigInt64(3, true), 0n, "sample.getBigInt64(3, true)"); +assert.sameValue(sample.getBigInt64(4, true), 0n, "sample.getBigInt64(4, true)"); +assert.sameValue(sample.getBigInt64(0, false), 0n, "sample.getBigInt64(0, false)"); +assert.sameValue(sample.getBigInt64(1, false), 0n, "sample.getBigInt64(1, false)"); +assert.sameValue(sample.getBigInt64(2, false), 0n, "sample.getBigInt64(2, false)"); +assert.sameValue(sample.getBigInt64(3, false), 0n, "sample.getBigInt64(3, false)"); +assert.sameValue(sample.getBigInt64(4, false), 0n, "sample.getBigInt64(4, false)"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js b/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js index d6fcf8f71..daa5790ae 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js @@ -55,14 +55,14 @@ sample.setUint8(15, 0x80); sample = new DataView(buffer, 4); -assert.sameValue(sample.getBigInt64(0, false), -0x7fff7ffe80fffefe n, "0, false"); -assert.sameValue(sample.getBigInt64(1, false), 0x80017f00010280 n, "1, false"); -assert.sameValue(sample.getBigInt64(2, false), -0x7ffe80fffefd7f81 n, "2, false"); -assert.sameValue(sample.getBigInt64(3, false), 0x17f000102807fff n, "3, false"); -assert.sameValue(sample.getBigInt64(4, false), 0x7f000102807fff80 n, "4, false"); +assert.sameValue(sample.getBigInt64(0, false), -0x7fff7ffe80fffefen, "0, false"); +assert.sameValue(sample.getBigInt64(1, false), 0x80017f00010280n, "1, false"); +assert.sameValue(sample.getBigInt64(2, false), -0x7ffe80fffefd7f81n, "2, false"); +assert.sameValue(sample.getBigInt64(3, false), 0x17f000102807fffn, "3, false"); +assert.sameValue(sample.getBigInt64(4, false), 0x7f000102807fff80n, "4, false"); -assert.sameValue(sample.getBigInt64(0, true), 0x201007f01800080 n, "0, true"); -assert.sameValue(sample.getBigInt64(1, true), -0x7ffdfeff80fe8000 n, "1, true"); -assert.sameValue(sample.getBigInt64(2, true), 0x7f800201007f0180 n, "2, true"); -assert.sameValue(sample.getBigInt64(3, true), -0x807ffdfeff80ff n, "3, true"); -assert.sameValue(sample.getBigInt64(4, true), -0x7f00807ffdfeff81 n, "4, true"); +assert.sameValue(sample.getBigInt64(0, true), 0x201007f01800080n, "0, true"); +assert.sameValue(sample.getBigInt64(1, true), -0x7ffdfeff80fe8000n, "1, true"); +assert.sameValue(sample.getBigInt64(2, true), 0x7f800201007f0180n, "2, true"); +assert.sameValue(sample.getBigInt64(3, true), -0x807ffdfeff80ffn, "3, true"); +assert.sameValue(sample.getBigInt64(4, true), -0x7f00807ffdfeff81n, "4, true"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-values.js b/test/built-ins/DataView/prototype/getBigInt64/return-values.js index 66a7ee008..a9b6fdd83 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/return-values.js +++ b/test/built-ins/DataView/prototype/getBigInt64/return-values.js @@ -48,22 +48,22 @@ sample.setUint8(13, 0x7f); sample.setUint8(14, 0xff); sample.setUint8(15, 0x80); -assert.sameValue(sample.getBigInt64(0, false), 0x2702060280008001 n, "0, false"); -assert.sameValue(sample.getBigInt64(1, false), 0x20602800080017f n, "1, false"); -assert.sameValue(sample.getBigInt64(2, false), 0x602800080017f00 n, "2, false"); -assert.sameValue(sample.getBigInt64(3, false), 0x2800080017f0001 n, "3, false"); -assert.sameValue(sample.getBigInt64(4, false), -0x7fff7ffe80fffefe n, "4, false"); -assert.sameValue(sample.getBigInt64(5, false), 0x80017f00010280 n, "5, false"); -assert.sameValue(sample.getBigInt64(6, false), -0x7ffe80fffefd7f81 n, "6, false"); -assert.sameValue(sample.getBigInt64(7, false), 0x17f000102807fff n, "7, false"); -assert.sameValue(sample.getBigInt64(8, false), 0x7f000102807fff80 n, "8, false"); +assert.sameValue(sample.getBigInt64(0, false), 0x2702060280008001n, "0, false"); +assert.sameValue(sample.getBigInt64(1, false), 0x20602800080017fn, "1, false"); +assert.sameValue(sample.getBigInt64(2, false), 0x602800080017f00n, "2, false"); +assert.sameValue(sample.getBigInt64(3, false), 0x2800080017f0001n, "3, false"); +assert.sameValue(sample.getBigInt64(4, false), -0x7fff7ffe80fffefen, "4, false"); +assert.sameValue(sample.getBigInt64(5, false), 0x80017f00010280n, "5, false"); +assert.sameValue(sample.getBigInt64(6, false), -0x7ffe80fffefd7f81n, "6, false"); +assert.sameValue(sample.getBigInt64(7, false), 0x17f000102807fffn, "7, false"); +assert.sameValue(sample.getBigInt64(8, false), 0x7f000102807fff80n, "8, false"); -assert.sameValue(sample.getBigInt64(0, true), 0x180008002060227 n, "0, true"); -assert.sameValue(sample.getBigInt64(1, true), 0x7f01800080020602 n, "1, true"); -assert.sameValue(sample.getBigInt64(2, true), 0x7f018000800206 n, "2, true"); -assert.sameValue(sample.getBigInt64(3, true), 0x1007f0180008002 n, "3, true"); -assert.sameValue(sample.getBigInt64(4, true), 0x201007f01800080 n, "4, true"); -assert.sameValue(sample.getBigInt64(5, true), -0x7ffdfeff80fe8000 n, "5, true"); -assert.sameValue(sample.getBigInt64(6, true), 0x7f800201007f0180 n, "6, true"); -assert.sameValue(sample.getBigInt64(7, true), -0x807ffdfeff80ff n, "7, true"); -assert.sameValue(sample.getBigInt64(8, true), -0x7f00807ffdfeff81 n, "8, true"); +assert.sameValue(sample.getBigInt64(0, true), 0x180008002060227n, "0, true"); +assert.sameValue(sample.getBigInt64(1, true), 0x7f01800080020602n, "1, true"); +assert.sameValue(sample.getBigInt64(2, true), 0x7f018000800206n, "2, true"); +assert.sameValue(sample.getBigInt64(3, true), 0x1007f0180008002n, "3, true"); +assert.sameValue(sample.getBigInt64(4, true), 0x201007f01800080n, "4, true"); +assert.sameValue(sample.getBigInt64(5, true), -0x7ffdfeff80fe8000n, "5, true"); +assert.sameValue(sample.getBigInt64(6, true), 0x7f800201007f0180n, "6, true"); +assert.sameValue(sample.getBigInt64(7, true), -0x807ffdfeff80ffn, "7, true"); +assert.sameValue(sample.getBigInt64(8, true), -0x7f00807ffdfeff81n, "8, true"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js index cf8682a05..1dad1108d 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js +++ b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js @@ -21,7 +21,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function] var getBigInt64 = DataView.prototype.getBigInt64; assert.throws(TypeError, () => getBigInt64.call(undefined), - "undefined"); + "undefined"); assert.throws(TypeError, () => getBigInt64.call(null), "null"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js b/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js index d0be65d63..9ab87b5e1 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js +++ b/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js @@ -36,32 +36,32 @@ features: [ArrayBuffer, BigInt, DataView, DataView.prototype.setUint8, Symbol] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(7, 0xff); -assert.sameValue(sample.getBigInt64(0), 0xff n, "no argument"); +assert.sameValue(sample.getBigInt64(0), 0xffn, "no argument"); -assert.sameValue(sample.getBigInt64(0, false), 0xff n); -assert.sameValue(sample.getBigInt64(0, true), -0x100000000000000 n); -assert.sameValue(sample.getBigInt64(0, 0), 0xff n, "ToBoolean: 0 => false"); -assert.sameValue(sample.getBigInt64(0, -0), 0xff n, "ToBoolean: -0 => false"); -assert.sameValue(sample.getBigInt64(0, 1), -0x100000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigInt64(0, -1), -0x100000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigInt64(0, 0.1), -0x100000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigInt64(0, Infinity), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, false), 0xffn); +assert.sameValue(sample.getBigInt64(0, true), -0x100000000000000n); +assert.sameValue(sample.getBigInt64(0, 0), 0xffn, "ToBoolean: 0 => false"); +assert.sameValue(sample.getBigInt64(0, -0), 0xffn, "ToBoolean: -0 => false"); +assert.sameValue(sample.getBigInt64(0, 1), -0x100000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigInt64(0, -1), -0x100000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigInt64(0, 0.1), -0x100000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigInt64(0, Infinity), -0x100000000000000n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigInt64(0, NaN), 0xff n, "ToBoolean: NaN => false"); -assert.sameValue(sample.getBigInt64(0, undefined), 0xff n, "ToBoolean: undefined => false"); -assert.sameValue(sample.getBigInt64(0, null), 0xff n, "ToBoolean: null => false"); -assert.sameValue(sample.getBigInt64(0, ""), 0xff n, "ToBoolean: String .length == 0 => false"); -assert.sameValue(sample.getBigInt64(0, "string"), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, NaN), 0xffn, "ToBoolean: NaN => false"); +assert.sameValue(sample.getBigInt64(0, undefined), 0xffn, "ToBoolean: undefined => false"); +assert.sameValue(sample.getBigInt64(0, null), 0xffn, "ToBoolean: null => false"); +assert.sameValue(sample.getBigInt64(0, ""), 0xffn, "ToBoolean: String .length == 0 => false"); +assert.sameValue(sample.getBigInt64(0, "string"), -0x100000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigInt64(0, "false"), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, "false"), -0x100000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigInt64(0, " "), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, " "), -0x100000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigInt64(0, Symbol("1")), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, Symbol("1")), -0x100000000000000n, "ToBoolean: Symbol => true"); -assert.sameValue(sample.getBigInt64(0, 0 n), 0xff n, "ToBoolean: 0n => false"); -assert.sameValue(sample.getBigInt64(0, 1 n), -0x100000000000000 n, "ToBoolean: BigInt != 0n => true"); -assert.sameValue(sample.getBigInt64(0, []), -0x100000000000000 n, "ToBoolean: any object => true"); -assert.sameValue(sample.getBigInt64(0, {}), -0x100000000000000 n, "ToBoolean: any object => true"); -assert.sameValue(sample.getBigInt64(0, Object(false)), -0x100000000000000 n, +assert.sameValue(sample.getBigInt64(0, 0n), 0xffn, "ToBoolean: 0n => false"); +assert.sameValue(sample.getBigInt64(0, 1n), -0x100000000000000n, "ToBoolean: BigInt != 0n => true"); +assert.sameValue(sample.getBigInt64(0, []), -0x100000000000000n, "ToBoolean: any object => true"); +assert.sameValue(sample.getBigInt64(0, {}), -0x100000000000000n, "ToBoolean: any object => true"); +assert.sameValue(sample.getBigInt64(0, Object(false)), -0x100000000000000n, "ToBoolean: any object => true; no ToPrimitive"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js index bfa9c9c99..c96648cec 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js +++ b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js @@ -52,29 +52,29 @@ assert.throws(RangeError, function() { sample.getBigInt64(Infinity); }, "ToIndex: throw when integerIndex > 2**53-1"); assert.throws(TypeError, function() { - sample.getBigInt64(0 n); + sample.getBigInt64(0n); }, "ToIndex: BigInt => TypeError"); assert.throws(TypeError, function() { - sample.getBigInt64(Object(0 n)); + sample.getBigInt64(Object(0n)); }, "ToIndex: unbox object with internal slot => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigInt64({ [Symbol.toPrimitive]: function() { - return 0 n; + return 0n; } }); }, "ToIndex: @@toPrimitive => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigInt64({ valueOf: function() { - return 0 n; + return 0n; } }); }, "ToIndex: valueOf => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigInt64({ toString: function() { - return 0 n; + return 0n; } }); }, "ToIndex: toString => BigInt => TypeError"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js index 9d345ac24..f5476694a 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js +++ b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js @@ -45,48 +45,48 @@ assert.sameValue(sample.getBigInt64({ }, valueOf: err, toString: err -}), 0x20602800080017f n, "ToPrimitive: @@toPrimitive takes precedence"); +}), 0x20602800080017fn, "ToPrimitive: @@toPrimitive takes precedence"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return 1; }, toString: err -}), 0x20602800080017f n, "ToPrimitive: valueOf takes precedence over toString"); +}), 0x20602800080017fn, "ToPrimitive: valueOf takes precedence over toString"); assert.sameValue(sample.getBigInt64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: toString with no valueOf"); +}), 0x20602800080017fn, "ToPrimitive: toString with no valueOf"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: undefined, valueOf: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip @@toPrimitive when it's undefined"); +}), 0x20602800080017fn, "ToPrimitive: skip @@toPrimitive when it's undefined"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: null, valueOf: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip @@toPrimitive when it's null"); +}), 0x20602800080017fn, "ToPrimitive: skip @@toPrimitive when it's null"); assert.sameValue(sample.getBigInt64({ valueOf: null, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigInt64({ valueOf: 1, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigInt64({ valueOf: {}, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return {}; @@ -94,7 +94,7 @@ assert.sameValue(sample.getBigInt64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it returns an object"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it returns an object"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return Object(12345); @@ -102,7 +102,7 @@ assert.sameValue(sample.getBigInt64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it returns an object"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it returns an object"); assert.throws(TypeError, function() { sample.getBigInt64({ [Symbol.toPrimitive]: 1 diff --git a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js index b0baccc94..cddda9ee4 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js +++ b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js @@ -33,101 +33,101 @@ sample.setUint8(9, 0x00); sample.setUint8(10, 0x01); sample.setUint8(11, 0x02); -assert.sameValue(sample.getBigInt64(Object(0)), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64(Object(0)), 0x2702060280008001n, "ToPrimitive: unbox object with internal slot"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: @@toPrimitive"); +}), 0x2702060280008001n, "ToPrimitive: @@toPrimitive"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: valueOf"); +}), 0x2702060280008001n, "ToPrimitive: valueOf"); assert.sameValue(sample.getBigInt64({ toString: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: toString"); -assert.sameValue(sample.getBigInt64(Object(NaN)), 0x2702060280008001 n, +}), 0x2702060280008001n, "ToPrimitive: toString"); +assert.sameValue(sample.getBigInt64(Object(NaN)), 0x2702060280008001n, "ToIndex: unbox object with internal slot => NaN => 0"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => NaN => 0"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: valueOf => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => NaN => 0"); assert.sameValue(sample.getBigInt64({ toString: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: toString => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: toString => NaN => 0"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => undefined => NaN => 0"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: valueOf => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => undefined => NaN => 0"); assert.sameValue(sample.getBigInt64({ toString: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: toString => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: toString => undefined => NaN => 0"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => null => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => null => 0"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: valueOf => null => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => null => 0"); assert.sameValue(sample.getBigInt64({ toString: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: toString => null => 0"); -assert.sameValue(sample.getBigInt64(Object(true)), 0x20602800080017f n, +}), 0x2702060280008001n, "ToIndex: toString => null => 0"); +assert.sameValue(sample.getBigInt64(Object(true)), 0x20602800080017fn, "ToIndex: unbox object with internal slot => true => 1"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return true; } -}), 0x20602800080017f n, "ToIndex: @@toPrimitive => true => 1"); +}), 0x20602800080017fn, "ToIndex: @@toPrimitive => true => 1"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return true; } -}), 0x20602800080017f n, "ToIndex: valueOf => true => 1"); +}), 0x20602800080017fn, "ToIndex: valueOf => true => 1"); assert.sameValue(sample.getBigInt64({ toString: function() { return true; } -}), 0x20602800080017f n, "ToIndex: toString => true => 1"); -assert.sameValue(sample.getBigInt64(Object("1")), 0x20602800080017f n, +}), 0x20602800080017fn, "ToIndex: toString => true => 1"); +assert.sameValue(sample.getBigInt64(Object("1")), 0x20602800080017fn, "ToIndex: unbox object with internal slot => parse Number"); assert.sameValue(sample.getBigInt64({ [Symbol.toPrimitive]: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: @@toPrimitive => parse Number"); +}), 0x20602800080017fn, "ToIndex: @@toPrimitive => parse Number"); assert.sameValue(sample.getBigInt64({ valueOf: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: valueOf => parse Number"); +}), 0x20602800080017fn, "ToIndex: valueOf => parse Number"); assert.sameValue(sample.getBigInt64({ toString: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: toString => parse Number"); +}), 0x20602800080017fn, "ToIndex: toString => parse Number"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js index d9367fd3c..70a5cdba8 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js @@ -33,38 +33,38 @@ sample.setUint8(9, 0x00); sample.setUint8(10, 0x01); sample.setUint8(11, 0x02); -assert.sameValue(sample.getBigInt64(0), 0x2702060280008001 n); -assert.sameValue(sample.getBigInt64(1), 0x20602800080017f n); -assert.sameValue(sample.getBigInt64(-0.9), 0x2702060280008001 n, "ToIndex: truncate towards 0"); -assert.sameValue(sample.getBigInt64(0.9), 0x2702060280008001 n, "ToIndex: truncate towards 0"); -assert.sameValue(sample.getBigInt64(NaN), 0x2702060280008001 n, "ToIndex: NaN => 0"); -assert.sameValue(sample.getBigInt64(undefined), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64(0), 0x2702060280008001n); +assert.sameValue(sample.getBigInt64(1), 0x20602800080017fn); +assert.sameValue(sample.getBigInt64(-0.9), 0x2702060280008001n, "ToIndex: truncate towards 0"); +assert.sameValue(sample.getBigInt64(0.9), 0x2702060280008001n, "ToIndex: truncate towards 0"); +assert.sameValue(sample.getBigInt64(NaN), 0x2702060280008001n, "ToIndex: NaN => 0"); +assert.sameValue(sample.getBigInt64(undefined), 0x2702060280008001n, "ToIndex: undefined => NaN => 0"); -assert.sameValue(sample.getBigInt64(null), 0x2702060280008001 n, "ToIndex: null => 0"); -assert.sameValue(sample.getBigInt64(false), 0x2702060280008001 n, "ToIndex: false => 0"); -assert.sameValue(sample.getBigInt64(true), 0x20602800080017f n, "ToIndex: true => 1"); -assert.sameValue(sample.getBigInt64("0"), 0x2702060280008001 n, "ToIndex: parse Number"); -assert.sameValue(sample.getBigInt64("1"), 0x20602800080017f n, "ToIndex: parse Number"); -assert.sameValue(sample.getBigInt64(""), 0x2702060280008001 n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigInt64("foo"), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64(null), 0x2702060280008001n, "ToIndex: null => 0"); +assert.sameValue(sample.getBigInt64(false), 0x2702060280008001n, "ToIndex: false => 0"); +assert.sameValue(sample.getBigInt64(true), 0x20602800080017fn, "ToIndex: true => 1"); +assert.sameValue(sample.getBigInt64("0"), 0x2702060280008001n, "ToIndex: parse Number"); +assert.sameValue(sample.getBigInt64("1"), 0x20602800080017fn, "ToIndex: parse Number"); +assert.sameValue(sample.getBigInt64(""), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); +assert.sameValue(sample.getBigInt64("foo"), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigInt64("true"), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64("true"), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigInt64(2), 0x602800080017F00 n); -assert.sameValue(sample.getBigInt64("2"), 0x602800080017F00 n, "toIndex: parse Number"); -assert.sameValue(sample.getBigInt64(2.9), 0x602800080017F00 n, "toIndex: truncate towards 0"); -assert.sameValue(sample.getBigInt64("2.9"), 0x602800080017F00 n, +assert.sameValue(sample.getBigInt64(2), 0x602800080017F00n); +assert.sameValue(sample.getBigInt64("2"), 0x602800080017F00n, "toIndex: parse Number"); +assert.sameValue(sample.getBigInt64(2.9), 0x602800080017F00n, "toIndex: truncate towards 0"); +assert.sameValue(sample.getBigInt64("2.9"), 0x602800080017F00n, "toIndex: parse Number => truncate towards 0"); -assert.sameValue(sample.getBigInt64(3), 0x2800080017F0001 n); -assert.sameValue(sample.getBigInt64("3"), 0x2800080017F0001 n, "toIndex: parse Number"); -assert.sameValue(sample.getBigInt64(3.9), 0x2800080017F0001 n, "toIndex: truncate towards 0"); -assert.sameValue(sample.getBigInt64("3.9"), 0x2800080017F0001 n, +assert.sameValue(sample.getBigInt64(3), 0x2800080017F0001n); +assert.sameValue(sample.getBigInt64("3"), 0x2800080017F0001n, "toIndex: parse Number"); +assert.sameValue(sample.getBigInt64(3.9), 0x2800080017F0001n, "toIndex: truncate towards 0"); +assert.sameValue(sample.getBigInt64("3.9"), 0x2800080017F0001n, "toIndex: parse Number => truncate towards 0"); -assert.sameValue(sample.getBigInt64([0]), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64([0]), 0x2702060280008001n, 'ToIndex: [0].toString() => "0" => 0'); -assert.sameValue(sample.getBigInt64(["1"]), 0x20602800080017f n, +assert.sameValue(sample.getBigInt64(["1"]), 0x20602800080017fn, 'ToIndex: ["1"].toString() => "1" => 1'); -assert.sameValue(sample.getBigInt64({}), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64({}), 0x2702060280008001n, 'ToIndex: ({}).toString() => "[object Object]" => NaN => 0'); -assert.sameValue(sample.getBigInt64([]), 0x2702060280008001 n, +assert.sameValue(sample.getBigInt64([]), 0x2702060280008001n, 'ToIndex: [].toString() => "" => NaN => 0'); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js index 894b55068..a96d8c9c5 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js @@ -15,7 +15,7 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(RangeError, () => sample.getBigUint64(Infinity), - "DataView access at index Infinity should throw"); + "DataView access at index Infinity should throw"); assert.throws(RangeError, () => sample.getBigUint64(-1), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js index 4155c6d69..9b0fb3d27 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js @@ -17,4 +17,4 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigUint64(13), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js index de42ea298..b3fdb8b29 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js @@ -14,4 +14,4 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigUint64(0), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js index 7f25d2e67..88f38cb64 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js +++ b/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js @@ -14,7 +14,7 @@ var buffer = new ArrayBuffer(12); sample = new DataView(buffer, 0); assert.throws(RangeError, () => sample.getBigUint64(Infinity), - "DataView access at index Infinity should throw"); + "DataView access at index Infinity should throw"); assert.throws(RangeError, () => sample.getBigUint64(13), "13 + 8 > 12"); @@ -36,24 +36,24 @@ assert.throws(RangeError, () => sample.getBigUint64(5), "5 + 8 > 12"); sample = new DataView(buffer, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 4 (offset)"); + "1 + 8 > 4 (offset)"); sample = new DataView(buffer, 9); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 3 (offset)"); + "0 + 8 > 3 (offset)"); sample = new DataView(buffer, 0, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 8 (length)"); + "1 + 8 > 8 (length)"); sample = new DataView(buffer, 0, 7); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 7 (length)"); + "0 + 8 > 7 (length)"); sample = new DataView(buffer, 4, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 8 (offset+length)"); + "1 + 8 > 8 (offset+length)"); sample = new DataView(buffer, 4, 7); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 7 (offset+length)"); + "0 + 8 > 7 (offset+length)"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js index ea981f687..3216d86c8 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js +++ b/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js @@ -12,7 +12,7 @@ var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); assert.throws(RangeError, () => sample.getBigUint64(-1), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); assert.throws(RangeError, () => sample.getBigUint64(-Infinity), - "DataView access at index -Infinity should throw"); + "DataView access at index -Infinity should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js index 5482c5d1b..4f7bb9596 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js @@ -11,16 +11,8 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { - valueOf() { - throw new Test262Error(); - } -}; -var bo2 = { - toString() { - throw new Test262Error(); - } -}; +var bo1 = { valueOf() { throw new Test262Error(); } }; +var bo2 = { toString() { throw new Test262Error(); } }; assert.throws(Test262Error, () => sample.getBigUint64(bo1), "valueOf"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js b/test/built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js index 37de5946e..25ee7766d 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js +++ b/test/built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js @@ -11,13 +11,13 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); -assert.sameValue(sample.getBigUint64(0, true), 0 n, "sample.getBigUint64(0, true)"); -assert.sameValue(sample.getBigUint64(1, true), 0 n, "sample.getBigUint64(1, true)"); -assert.sameValue(sample.getBigUint64(2, true), 0 n, "sample.getBigUint64(2, true)"); -assert.sameValue(sample.getBigUint64(3, true), 0 n, "sample.getBigUint64(3, true)"); -assert.sameValue(sample.getBigUint64(4, true), 0 n, "sample.getBigUint64(4, true)"); -assert.sameValue(sample.getBigUint64(0, false), 0 n, "sample.getBigUint64(0, false)"); -assert.sameValue(sample.getBigUint64(1, false), 0 n, "sample.getBigUint64(1, false)"); -assert.sameValue(sample.getBigUint64(2, false), 0 n, "sample.getBigUint64(2, false)"); -assert.sameValue(sample.getBigUint64(3, false), 0 n, "sample.getBigUint64(3, false)"); -assert.sameValue(sample.getBigUint64(4, false), 0 n, "sample.getBigUint64(4, false)"); +assert.sameValue(sample.getBigUint64(0, true), 0n, "sample.getBigUint64(0, true)"); +assert.sameValue(sample.getBigUint64(1, true), 0n, "sample.getBigUint64(1, true)"); +assert.sameValue(sample.getBigUint64(2, true), 0n, "sample.getBigUint64(2, true)"); +assert.sameValue(sample.getBigUint64(3, true), 0n, "sample.getBigUint64(3, true)"); +assert.sameValue(sample.getBigUint64(4, true), 0n, "sample.getBigUint64(4, true)"); +assert.sameValue(sample.getBigUint64(0, false), 0n, "sample.getBigUint64(0, false)"); +assert.sameValue(sample.getBigUint64(1, false), 0n, "sample.getBigUint64(1, false)"); +assert.sameValue(sample.getBigUint64(2, false), 0n, "sample.getBigUint64(2, false)"); +assert.sameValue(sample.getBigUint64(3, false), 0n, "sample.getBigUint64(3, false)"); +assert.sameValue(sample.getBigUint64(4, false), 0n, "sample.getBigUint64(4, false)"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js b/test/built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js index 26cb5349f..074c8a279 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js @@ -30,14 +30,14 @@ sample.setUint8(15, 0x80); sample = new DataView(buffer, 4); -assert.sameValue(sample.getBigUint64(0, false), 0x800080017f000102 n, "0, false"); -assert.sameValue(sample.getBigUint64(1, false), 0x80017f00010280 n, "1, false"); -assert.sameValue(sample.getBigUint64(2, false), 0x80017f000102807f n, "2, false"); -assert.sameValue(sample.getBigUint64(3, false), 0x17f000102807fff n, "3, false"); -assert.sameValue(sample.getBigUint64(4, false), 0x7f000102807fff80 n, "4, false"); +assert.sameValue(sample.getBigUint64(0, false), 0x800080017f000102n, "0, false"); +assert.sameValue(sample.getBigUint64(1, false), 0x80017f00010280n, "1, false"); +assert.sameValue(sample.getBigUint64(2, false), 0x80017f000102807fn, "2, false"); +assert.sameValue(sample.getBigUint64(3, false), 0x17f000102807fffn, "3, false"); +assert.sameValue(sample.getBigUint64(4, false), 0x7f000102807fff80n, "4, false"); -assert.sameValue(sample.getBigUint64(0, true), 0x201007f01800080 n, "0, true"); -assert.sameValue(sample.getBigUint64(1, true), 0x800201007f018000 n, "1, true"); -assert.sameValue(sample.getBigUint64(2, true), 0x7f800201007f0180 n, "2, true"); -assert.sameValue(sample.getBigUint64(3, true), 0xff7f800201007f01 n, "3, true"); -assert.sameValue(sample.getBigUint64(4, true), 0x80ff7f800201007f n, "4, true"); +assert.sameValue(sample.getBigUint64(0, true), 0x201007f01800080n, "0, true"); +assert.sameValue(sample.getBigUint64(1, true), 0x800201007f018000n, "1, true"); +assert.sameValue(sample.getBigUint64(2, true), 0x7f800201007f0180n, "2, true"); +assert.sameValue(sample.getBigUint64(3, true), 0xff7f800201007f01n, "3, true"); +assert.sameValue(sample.getBigUint64(4, true), 0x80ff7f800201007fn, "4, true"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/return-values.js b/test/built-ins/DataView/prototype/getBigUint64/return-values.js index 4ed45b127..7b6b4250b 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/return-values.js +++ b/test/built-ins/DataView/prototype/getBigUint64/return-values.js @@ -28,22 +28,22 @@ sample.setUint8(13, 0x7f); sample.setUint8(14, 0xff); sample.setUint8(15, 0x80); -assert.sameValue(sample.getBigUint64(0, false), 0x2702060280008001 n, "0, false"); -assert.sameValue(sample.getBigUint64(1, false), 0x20602800080017f n, "1, false"); -assert.sameValue(sample.getBigUint64(2, false), 0x602800080017f00 n, "2, false"); -assert.sameValue(sample.getBigUint64(3, false), 0x2800080017f0001 n, "3, false"); -assert.sameValue(sample.getBigUint64(4, false), 0x800080017f000102 n, "4, false"); -assert.sameValue(sample.getBigUint64(5, false), 0x80017f00010280 n, "5, false"); -assert.sameValue(sample.getBigUint64(6, false), 0x80017f000102807f n, "6, false"); -assert.sameValue(sample.getBigUint64(7, false), 0x17f000102807fff n, "7, false"); -assert.sameValue(sample.getBigUint64(8, false), 0x7f000102807fff80 n, "8, false"); +assert.sameValue(sample.getBigUint64(0, false), 0x2702060280008001n, "0, false"); +assert.sameValue(sample.getBigUint64(1, false), 0x20602800080017fn, "1, false"); +assert.sameValue(sample.getBigUint64(2, false), 0x602800080017f00n, "2, false"); +assert.sameValue(sample.getBigUint64(3, false), 0x2800080017f0001n, "3, false"); +assert.sameValue(sample.getBigUint64(4, false), 0x800080017f000102n, "4, false"); +assert.sameValue(sample.getBigUint64(5, false), 0x80017f00010280n, "5, false"); +assert.sameValue(sample.getBigUint64(6, false), 0x80017f000102807fn, "6, false"); +assert.sameValue(sample.getBigUint64(7, false), 0x17f000102807fffn, "7, false"); +assert.sameValue(sample.getBigUint64(8, false), 0x7f000102807fff80n, "8, false"); -assert.sameValue(sample.getBigUint64(0, true), 0x180008002060227 n, "0, true"); -assert.sameValue(sample.getBigUint64(1, true), 0x7f01800080020602 n, "1, true"); -assert.sameValue(sample.getBigUint64(2, true), 0x7f018000800206 n, "2, true"); -assert.sameValue(sample.getBigUint64(3, true), 0x1007f0180008002 n, "3, true"); -assert.sameValue(sample.getBigUint64(4, true), 0x201007f01800080 n, "4, true"); -assert.sameValue(sample.getBigUint64(5, true), 0x800201007F018000 n, "5, true"); -assert.sameValue(sample.getBigUint64(6, true), 0x7f800201007f0180 n, "6, true"); -assert.sameValue(sample.getBigUint64(7, true), 0xff7f800201007f01 n, "7, true"); -assert.sameValue(sample.getBigUint64(8, true), 0x80ff7f800201007f n, "8, true"); +assert.sameValue(sample.getBigUint64(0, true), 0x180008002060227n, "0, true"); +assert.sameValue(sample.getBigUint64(1, true), 0x7f01800080020602n, "1, true"); +assert.sameValue(sample.getBigUint64(2, true), 0x7f018000800206n, "2, true"); +assert.sameValue(sample.getBigUint64(3, true), 0x1007f0180008002n, "3, true"); +assert.sameValue(sample.getBigUint64(4, true), 0x201007f01800080n, "4, true"); +assert.sameValue(sample.getBigUint64(5, true), 0x800201007F018000n, "5, true"); +assert.sameValue(sample.getBigUint64(6, true), 0x7f800201007f0180n, "6, true"); +assert.sameValue(sample.getBigUint64(7, true), 0xff7f800201007f01n, "7, true"); +assert.sameValue(sample.getBigUint64(8, true), 0x80ff7f800201007fn, "8, true"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js b/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js index 4c3d250c6..a60b3cca3 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js +++ b/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js @@ -10,7 +10,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function] var getBigUint64 = DataView.prototype.getBigUint64; assert.throws(TypeError, () => getBigUint64.call(undefined), - "undefined"); + "undefined"); assert.throws(TypeError, () => getBigUint64.call(null), "null"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js b/test/built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js index fd14414eb..4885dfe41 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js +++ b/test/built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js @@ -9,32 +9,32 @@ features: [ArrayBuffer, BigInt, DataView, DataView.prototype.setUint8, Symbol] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(7, 0xff); -assert.sameValue(sample.getBigUint64(0), 0xff n, "no argument"); +assert.sameValue(sample.getBigUint64(0), 0xffn, "no argument"); -assert.sameValue(sample.getBigUint64(0, false), 0xff n); -assert.sameValue(sample.getBigUint64(0, true), 0xff00000000000000 n); -assert.sameValue(sample.getBigUint64(0, 0), 0xff n, "ToBoolean: 0 => false"); -assert.sameValue(sample.getBigUint64(0, -0), 0xff n, "ToBoolean: -0 => false"); -assert.sameValue(sample.getBigUint64(0, 1), 0xff00000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigUint64(0, -1), 0xff00000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigUint64(0, 0.1), 0xff00000000000000 n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigUint64(0, Infinity), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, false), 0xffn); +assert.sameValue(sample.getBigUint64(0, true), 0xff00000000000000n); +assert.sameValue(sample.getBigUint64(0, 0), 0xffn, "ToBoolean: 0 => false"); +assert.sameValue(sample.getBigUint64(0, -0), 0xffn, "ToBoolean: -0 => false"); +assert.sameValue(sample.getBigUint64(0, 1), 0xff00000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigUint64(0, -1), 0xff00000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigUint64(0, 0.1), 0xff00000000000000n, "ToBoolean: Number != 0 => true"); +assert.sameValue(sample.getBigUint64(0, Infinity), 0xff00000000000000n, "ToBoolean: Number != 0 => true"); -assert.sameValue(sample.getBigUint64(0, NaN), 0xff n, "ToBoolean: NaN => false"); -assert.sameValue(sample.getBigUint64(0, undefined), 0xff n, "ToBoolean: undefined => false"); -assert.sameValue(sample.getBigUint64(0, null), 0xff n, "ToBoolean: null => false"); -assert.sameValue(sample.getBigUint64(0, ""), 0xff n, "ToBoolean: String .length == 0 => false"); -assert.sameValue(sample.getBigUint64(0, "string"), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, NaN), 0xffn, "ToBoolean: NaN => false"); +assert.sameValue(sample.getBigUint64(0, undefined), 0xffn, "ToBoolean: undefined => false"); +assert.sameValue(sample.getBigUint64(0, null), 0xffn, "ToBoolean: null => false"); +assert.sameValue(sample.getBigUint64(0, ""), 0xffn, "ToBoolean: String .length == 0 => false"); +assert.sameValue(sample.getBigUint64(0, "string"), 0xff00000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigUint64(0, "false"), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, "false"), 0xff00000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigUint64(0, " "), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, " "), 0xff00000000000000n, "ToBoolean: String .length > 0 => true"); -assert.sameValue(sample.getBigUint64(0, Symbol("1")), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, Symbol("1")), 0xff00000000000000n, "ToBoolean: Symbol => true"); -assert.sameValue(sample.getBigUint64(0, 0 n), 0xff n, "ToBoolean: 0n => false"); -assert.sameValue(sample.getBigUint64(0, 1 n), 0xff00000000000000 n, "ToBoolean: BigInt != 0n => true"); -assert.sameValue(sample.getBigUint64(0, []), 0xff00000000000000 n, "ToBoolean: any object => true"); -assert.sameValue(sample.getBigUint64(0, {}), 0xff00000000000000 n, "ToBoolean: any object => true"); -assert.sameValue(sample.getBigUint64(0, Object(false)), 0xff00000000000000 n, +assert.sameValue(sample.getBigUint64(0, 0n), 0xffn, "ToBoolean: 0n => false"); +assert.sameValue(sample.getBigUint64(0, 1n), 0xff00000000000000n, "ToBoolean: BigInt != 0n => true"); +assert.sameValue(sample.getBigUint64(0, []), 0xff00000000000000n, "ToBoolean: any object => true"); +assert.sameValue(sample.getBigUint64(0, {}), 0xff00000000000000n, "ToBoolean: any object => true"); +assert.sameValue(sample.getBigUint64(0, Object(false)), 0xff00000000000000n, "ToBoolean: any object => true; no ToPrimitive"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js index 2dcbcacfc..c11af740c 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js +++ b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js @@ -40,29 +40,29 @@ assert.throws(RangeError, function() { sample.getBigUint64(Infinity); }, "ToIndex: throw when integerIndex > 2**53-1"); assert.throws(TypeError, function() { - sample.getBigUint64(0 n); + sample.getBigUint64(0n); }, "ToIndex: BigInt => TypeError"); assert.throws(TypeError, function() { - sample.getBigUint64(Object(0 n)); + sample.getBigUint64(Object(0n)); }, "ToIndex: unbox object with internal slot => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigUint64({ [Symbol.toPrimitive]: function() { - return 0 n; + return 0n; } }); }, "ToIndex: @@toPrimitive => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigUint64({ valueOf: function() { - return 0 n; + return 0n; } }); }, "ToIndex: valueOf => BigInt => TypeError"); assert.throws(TypeError, function() { sample.getBigUint64({ toString: function() { - return 0 n; + return 0n; } }); }, "ToIndex: toString => BigInt => TypeError"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js index 33d9f8307..243e23015 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js +++ b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js @@ -33,48 +33,48 @@ assert.sameValue(sample.getBigUint64({ }, valueOf: err, toString: err -}), 0x20602800080017f n, "ToPrimitive: @@toPrimitive takes precedence"); +}), 0x20602800080017fn, "ToPrimitive: @@toPrimitive takes precedence"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return 1; }, toString: err -}), 0x20602800080017f n, "ToPrimitive: valueOf takes precedence over toString"); +}), 0x20602800080017fn, "ToPrimitive: valueOf takes precedence over toString"); assert.sameValue(sample.getBigUint64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: toString with no valueOf"); +}), 0x20602800080017fn, "ToPrimitive: toString with no valueOf"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: undefined, valueOf: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip @@toPrimitive when it's undefined"); +}), 0x20602800080017fn, "ToPrimitive: skip @@toPrimitive when it's undefined"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: null, valueOf: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip @@toPrimitive when it's null"); +}), 0x20602800080017fn, "ToPrimitive: skip @@toPrimitive when it's null"); assert.sameValue(sample.getBigUint64({ valueOf: null, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigUint64({ valueOf: 1, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigUint64({ valueOf: {}, toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it's not callable"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it's not callable"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return {}; @@ -82,7 +82,7 @@ assert.sameValue(sample.getBigUint64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it returns an object"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it returns an object"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return Object(12345); @@ -90,7 +90,7 @@ assert.sameValue(sample.getBigUint64({ toString: function() { return 1; } -}), 0x20602800080017f n, "ToPrimitive: skip valueOf when it returns an object"); +}), 0x20602800080017fn, "ToPrimitive: skip valueOf when it returns an object"); assert.throws(TypeError, function() { sample.getBigUint64({ [Symbol.toPrimitive]: 1 diff --git a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js index c59cdba2c..8803f393c 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js +++ b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js @@ -21,101 +21,101 @@ sample.setUint8(9, 0x00); sample.setUint8(10, 0x01); sample.setUint8(11, 0x02); -assert.sameValue(sample.getBigUint64(Object(0)), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64(Object(0)), 0x2702060280008001n, "ToPrimitive: unbox object with internal slot"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: @@toPrimitive"); +}), 0x2702060280008001n, "ToPrimitive: @@toPrimitive"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: valueOf"); +}), 0x2702060280008001n, "ToPrimitive: valueOf"); assert.sameValue(sample.getBigUint64({ toString: function() { return 0; } -}), 0x2702060280008001 n, "ToPrimitive: toString"); -assert.sameValue(sample.getBigUint64(Object(NaN)), 0x2702060280008001 n, +}), 0x2702060280008001n, "ToPrimitive: toString"); +assert.sameValue(sample.getBigUint64(Object(NaN)), 0x2702060280008001n, "ToIndex: unbox object with internal slot => NaN => 0"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => NaN => 0"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: valueOf => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => NaN => 0"); assert.sameValue(sample.getBigUint64({ toString: function() { return NaN; } -}), 0x2702060280008001 n, "ToIndex: toString => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: toString => NaN => 0"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => undefined => NaN => 0"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: valueOf => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => undefined => NaN => 0"); assert.sameValue(sample.getBigUint64({ toString: function() { return undefined; } -}), 0x2702060280008001 n, "ToIndex: toString => undefined => NaN => 0"); +}), 0x2702060280008001n, "ToIndex: toString => undefined => NaN => 0"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: @@toPrimitive => null => 0"); +}), 0x2702060280008001n, "ToIndex: @@toPrimitive => null => 0"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: valueOf => null => 0"); +}), 0x2702060280008001n, "ToIndex: valueOf => null => 0"); assert.sameValue(sample.getBigUint64({ toString: function() { return null; } -}), 0x2702060280008001 n, "ToIndex: toString => null => 0"); -assert.sameValue(sample.getBigUint64(Object(true)), 0x20602800080017f n, +}), 0x2702060280008001n, "ToIndex: toString => null => 0"); +assert.sameValue(sample.getBigUint64(Object(true)), 0x20602800080017fn, "ToIndex: unbox object with internal slot => true => 1"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return true; } -}), 0x20602800080017f n, "ToIndex: @@toPrimitive => true => 1"); +}), 0x20602800080017fn, "ToIndex: @@toPrimitive => true => 1"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return true; } -}), 0x20602800080017f n, "ToIndex: valueOf => true => 1"); +}), 0x20602800080017fn, "ToIndex: valueOf => true => 1"); assert.sameValue(sample.getBigUint64({ toString: function() { return true; } -}), 0x20602800080017f n, "ToIndex: toString => true => 1"); -assert.sameValue(sample.getBigUint64(Object("1")), 0x20602800080017f n, +}), 0x20602800080017fn, "ToIndex: toString => true => 1"); +assert.sameValue(sample.getBigUint64(Object("1")), 0x20602800080017fn, "ToIndex: unbox object with internal slot => parse Number"); assert.sameValue(sample.getBigUint64({ [Symbol.toPrimitive]: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: @@toPrimitive => parse Number"); +}), 0x20602800080017fn, "ToIndex: @@toPrimitive => parse Number"); assert.sameValue(sample.getBigUint64({ valueOf: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: valueOf => parse Number"); +}), 0x20602800080017fn, "ToIndex: valueOf => parse Number"); assert.sameValue(sample.getBigUint64({ toString: function() { return "1"; } -}), 0x20602800080017f n, "ToIndex: toString => parse Number"); +}), 0x20602800080017fn, "ToIndex: toString => parse Number"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js index e43ab67de..fbc74dd2f 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js @@ -21,38 +21,38 @@ sample.setUint8(9, 0x00); sample.setUint8(10, 0x01); sample.setUint8(11, 0x02); -assert.sameValue(sample.getBigUint64(0), 0x2702060280008001 n); -assert.sameValue(sample.getBigUint64(1), 0x20602800080017f n); -assert.sameValue(sample.getBigUint64(-0.9), 0x2702060280008001 n, "ToIndex: truncate towards 0"); -assert.sameValue(sample.getBigUint64(0.9), 0x2702060280008001 n, "ToIndex: truncate towards 0"); -assert.sameValue(sample.getBigUint64(NaN), 0x2702060280008001 n, "ToIndex: NaN => 0"); -assert.sameValue(sample.getBigUint64(undefined), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64(0), 0x2702060280008001n); +assert.sameValue(sample.getBigUint64(1), 0x20602800080017fn); +assert.sameValue(sample.getBigUint64(-0.9), 0x2702060280008001n, "ToIndex: truncate towards 0"); +assert.sameValue(sample.getBigUint64(0.9), 0x2702060280008001n, "ToIndex: truncate towards 0"); +assert.sameValue(sample.getBigUint64(NaN), 0x2702060280008001n, "ToIndex: NaN => 0"); +assert.sameValue(sample.getBigUint64(undefined), 0x2702060280008001n, "ToIndex: undefined => NaN => 0"); -assert.sameValue(sample.getBigUint64(null), 0x2702060280008001 n, "ToIndex: null => 0"); -assert.sameValue(sample.getBigUint64(false), 0x2702060280008001 n, "ToIndex: false => 0"); -assert.sameValue(sample.getBigUint64(true), 0x20602800080017f n, "ToIndex: true => 1"); -assert.sameValue(sample.getBigUint64("0"), 0x2702060280008001 n, "ToIndex: parse Number"); -assert.sameValue(sample.getBigUint64("1"), 0x20602800080017f n, "ToIndex: parse Number"); -assert.sameValue(sample.getBigUint64(""), 0x2702060280008001 n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigUint64("foo"), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64(null), 0x2702060280008001n, "ToIndex: null => 0"); +assert.sameValue(sample.getBigUint64(false), 0x2702060280008001n, "ToIndex: false => 0"); +assert.sameValue(sample.getBigUint64(true), 0x20602800080017fn, "ToIndex: true => 1"); +assert.sameValue(sample.getBigUint64("0"), 0x2702060280008001n, "ToIndex: parse Number"); +assert.sameValue(sample.getBigUint64("1"), 0x20602800080017fn, "ToIndex: parse Number"); +assert.sameValue(sample.getBigUint64(""), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); +assert.sameValue(sample.getBigUint64("foo"), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigUint64("true"), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64("true"), 0x2702060280008001n, "ToIndex: parse Number => NaN => 0"); -assert.sameValue(sample.getBigUint64(2), 0x602800080017F00 n); -assert.sameValue(sample.getBigUint64("2"), 0x602800080017F00 n, "toIndex: parse Number"); -assert.sameValue(sample.getBigUint64(2.9), 0x602800080017F00 n, "toIndex: truncate towards 0"); -assert.sameValue(sample.getBigUint64("2.9"), 0x602800080017F00 n, +assert.sameValue(sample.getBigUint64(2), 0x602800080017F00n); +assert.sameValue(sample.getBigUint64("2"), 0x602800080017F00n, "toIndex: parse Number"); +assert.sameValue(sample.getBigUint64(2.9), 0x602800080017F00n, "toIndex: truncate towards 0"); +assert.sameValue(sample.getBigUint64("2.9"), 0x602800080017F00n, "toIndex: parse Number => truncate towards 0"); -assert.sameValue(sample.getBigUint64(3), 0x2800080017F0001 n); -assert.sameValue(sample.getBigUint64("3"), 0x2800080017F0001 n, "toIndex: parse Number"); -assert.sameValue(sample.getBigUint64(3.9), 0x2800080017F0001 n, "toIndex: truncate towards 0"); -assert.sameValue(sample.getBigUint64("3.9"), 0x2800080017F0001 n, +assert.sameValue(sample.getBigUint64(3), 0x2800080017F0001n); +assert.sameValue(sample.getBigUint64("3"), 0x2800080017F0001n, "toIndex: parse Number"); +assert.sameValue(sample.getBigUint64(3.9), 0x2800080017F0001n, "toIndex: truncate towards 0"); +assert.sameValue(sample.getBigUint64("3.9"), 0x2800080017F0001n, "toIndex: parse Number => truncate towards 0"); -assert.sameValue(sample.getBigUint64([0]), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64([0]), 0x2702060280008001n, 'ToIndex: [0].toString() => "0" => 0'); -assert.sameValue(sample.getBigUint64(["1"]), 0x20602800080017f n, +assert.sameValue(sample.getBigUint64(["1"]), 0x20602800080017fn, 'ToIndex: ["1"].toString() => "1" => 1'); -assert.sameValue(sample.getBigUint64({}), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64({}), 0x2702060280008001n, 'ToIndex: ({}).toString() => "[object Object]" => NaN => 0'); -assert.sameValue(sample.getBigUint64([]), 0x2702060280008001 n, +assert.sameValue(sample.getBigUint64([]), 0x2702060280008001n, 'ToIndex: [].toString() => "" => NaN => 0'); diff --git a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js index 48a491cb6..7a96e21ca 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js +++ b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js @@ -12,11 +12,7 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); -var v = { - valueOf() { - throw new Test262Error(); - } -}; +var v = { valueOf() { throw new Test262Error(); } }; $DETACHBUFFER(buffer); assert.throws(Test262Error, function() { diff --git a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer.js b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer.js index 4361bb71a..3b25b9497 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer.js +++ b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer.js @@ -14,5 +14,5 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, function() { - sample.setBigInt64(0, 0 n); + sample.setBigInt64(0, 0n); }); diff --git a/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js index 0852b5498..a092a47c3 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js @@ -12,9 +12,7 @@ features: [DataView, ArrayBuffer, BigInt] var dataView = new DataView(new ArrayBuffer(8), 0); var poisoned = { - valueOf() { - throw new Test262Error("valueOf called"); - } + valueOf() { throw new Test262Error("valueOf called"); } }; assert.throws(RangeError, function() { diff --git a/test/built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js index 420adff59..17664246e 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js +++ b/test/built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js @@ -14,75 +14,75 @@ var buffer = new ArrayBuffer(12); sample = new DataView(buffer, 0); assert.throws(RangeError, function() { - sample.setBigInt64(Infinity, 39 n); + sample.setBigInt64(Infinity, 39n); }, "getIndex == Infinity"); assert.throws(RangeError, function() { - sample.setBigInt64(13, 39 n); + sample.setBigInt64(13, 39n); }, "13 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(12, 39 n); + sample.setBigInt64(12, 39n); }, "12 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(11, 39 n); + sample.setBigInt64(11, 39n); }, "11 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(10, 39 n); + sample.setBigInt64(10, 39n); }, "10 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(9, 39 n); + sample.setBigInt64(9, 39n); }, "9 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(8, 39 n); + sample.setBigInt64(8, 39n); }, "8 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(7, 39 n); + sample.setBigInt64(7, 39n); }, "7 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(6, 39 n); + sample.setBigInt64(6, 39n); }, "6 + 8 > 12"); assert.throws(RangeError, function() { - sample.setBigInt64(5, 39 n); + sample.setBigInt64(5, 39n); }, "5 + 8 > 12"); sample = new DataView(buffer, 8); assert.throws(RangeError, function() { - sample.setBigInt64(1, 39 n); + sample.setBigInt64(1, 39n); }, "1 + 8 > 4 (offset)"); sample = new DataView(buffer, 9); assert.throws(RangeError, function() { - sample.setBigInt64(0, 39 n); + sample.setBigInt64(0, 39n); }, "0 + 8 > 3 (offset)"); sample = new DataView(buffer, 0, 8); assert.throws(RangeError, function() { - sample.setBigInt64(1, 39 n); + sample.setBigInt64(1, 39n); }, "1 + 8 > 8 (length)"); sample = new DataView(buffer, 0, 7); assert.throws(RangeError, function() { - sample.setBigInt64(0, 39 n); + sample.setBigInt64(0, 39n); }, "0 + 8 > 7 (length)"); sample = new DataView(buffer, 4, 8); assert.throws(RangeError, function() { - sample.setBigInt64(1, 39 n); + sample.setBigInt64(1, 39n); }, "1 + 8 > 8 (offset+length)"); sample = new DataView(buffer, 4, 7); assert.throws(RangeError, function() { - sample.setBigInt64(0, 39 n); + sample.setBigInt64(0, 39n); }, "0 + 8 > 7 (offset+length)"); sample = new DataView(buffer, 0); -assert.sameValue(sample.getBigInt64(0), 0 n, "[0] no value was set"); -assert.sameValue(sample.getBigInt64(4), 0 n, "[1] no value was set"); +assert.sameValue(sample.getBigInt64(0), 0n, "[0] no value was set"); +assert.sameValue(sample.getBigInt64(4), 0n, "[1] no value was set"); diff --git a/test/built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js index 9ad011062..fcb35cf21 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js +++ b/test/built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js @@ -12,11 +12,11 @@ var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); assert.throws(RangeError, function() { - sample.setBigInt64(-1, 39 n); + sample.setBigInt64(-1, 39n); }, "DataView access at index -1 should throw"); -assert.sameValue(sample.getBigInt64(0), 0 n, "-1 - no value was set"); +assert.sameValue(sample.getBigInt64(0), 0n, "-1 - no value was set"); assert.throws(RangeError, function() { - sample.setBigInt64(-Infinity, 39 n); + sample.setBigInt64(-Infinity, 39n); }, "DataView access at index -Infinity should throw"); -assert.sameValue(sample.getBigInt64(0), 0 n, "-Infinity - no value was set"); +assert.sameValue(sample.getBigInt64(0), 0n, "-Infinity - no value was set"); diff --git a/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js index 6c05febdd..85e88974c 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js @@ -10,11 +10,7 @@ features: [DataView, ArrayBuffer, BigInt] var dataView = new DataView(new ArrayBuffer(8), 0); -var poisoned = { - valueOf() { - throw new Test262Error(); - } -}; +var poisoned = { valueOf() { throw new Test262Error(); } }; assert.throws(Test262Error, function() { dataView.setBigInt64(100, poisoned); diff --git a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js index d09e12b13..0411fe56b 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js +++ b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js @@ -11,16 +11,8 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); -var bo1 = { - valueOf() { - throw new Test262Error(); - } -}; -var bo2 = { - toString() { - throw new Test262Error(); - } -}; +var bo1 = { valueOf() { throw new Test262Error(); } }; +var bo2 = { toString() { throw new Test262Error(); } }; assert.throws(Test262Error, function() { sample.setBigInt64(0, bo1); diff --git a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js index 566a7d54f..caddbafdb 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js +++ b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js @@ -14,5 +14,5 @@ var sample = new DataView(buffer, 0); var s = Symbol("1"); assert.throws(TypeError, function() { - sample.setBigInt64(s, 1 n); + sample.setBigInt64(s, 1n); }); diff --git a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js index 52ae143fd..c54224dec 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js @@ -11,21 +11,13 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { - valueOf() { - throw new Test262Error(); - } -}; -var bo2 = { - toString() { - throw new Test262Error(); - } -}; +var bo1 = { valueOf() { throw new Test262Error(); } }; +var bo2 = { toString() { throw new Test262Error(); } }; assert.throws(Test262Error, function() { - sample.setBigInt64(bo1, 1 n); + sample.setBigInt64(bo1, 1n); }, "valueOf"); assert.throws(Test262Error, function() { - sample.setBigInt64(bo2, 1 n); + sample.setBigInt64(bo2, 1n); }, "toString"); diff --git a/test/built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js b/test/built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js index 7716f66a3..9edb9da5b 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js +++ b/test/built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js @@ -13,26 +13,26 @@ var sample = new DataView(buffer, 0); var result; -result = sample.setBigInt64(0, -0x6f80ff08 n, true); +result = sample.setBigInt64(0, -0x6f80ff08n, true); assert.sameValue(result, undefined, "returns undefined #1"); -assert.sameValue(sample.getBigInt64(0), -0x7ff806f00000001 n); +assert.sameValue(sample.getBigInt64(0), -0x7ff806f00000001n); -result = sample.setBigInt64(0, -0x7ff8070 n, true); +result = sample.setBigInt64(0, -0x7ff8070n, true); assert.sameValue(result, undefined, "returns undefined #2"); -assert.sameValue(sample.getBigInt64(0), -0x6f80ff0700000001 n); +assert.sameValue(sample.getBigInt64(0), -0x6f80ff0700000001n); -result = sample.setBigInt64(0, 0x6f80ff08 n, true); +result = sample.setBigInt64(0, 0x6f80ff08n, true); assert.sameValue(result, undefined, "returns undefined #3"); -assert.sameValue(sample.getBigInt64(0), 0x8ff806f00000000 n); +assert.sameValue(sample.getBigInt64(0), 0x8ff806f00000000n); -result = sample.setBigInt64(0, 0x8ff806f n, true); +result = sample.setBigInt64(0, 0x8ff806fn, true); assert.sameValue(result, undefined, "returns undefined #4"); -assert.sameValue(sample.getBigInt64(0), 0x6f80ff0800000000 n); +assert.sameValue(sample.getBigInt64(0), 0x6f80ff0800000000n); -result = sample.setBigInt64(0, 0xf8007f90 n, true); +result = sample.setBigInt64(0, 0xf8007f90n, true); assert.sameValue(result, undefined, "returns undefined #5"); -assert.sameValue(sample.getBigInt64(0), -0x6f80ff0800000000 n); +assert.sameValue(sample.getBigInt64(0), -0x6f80ff0800000000n); -result = sample.setBigInt64(0, 0x907f00f8 n, true); +result = sample.setBigInt64(0, 0x907f00f8n, true); assert.sameValue(result, undefined, "returns undefined #6"); -assert.sameValue(sample.getBigInt64(0), -0x7ff807000000000 n); +assert.sameValue(sample.getBigInt64(0), -0x7ff807000000000n); diff --git a/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js b/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js index 4e2d481c1..a92ede6c6 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js +++ b/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js @@ -17,13 +17,13 @@ var values = byteConversionValues.values; values.forEach(function(value, i) { if (value === undefined) { assert.throws(TypeError, - () => sample.setBigInt64(0, BigInt(value), false), - "value: " + value); + () => sample.setBigInt64(0, BigInt(value), false), + "value: " + value); return; } else if (!Number.isInteger(value) || value > 9007199254740991) { assert.throws(RangeError, - () => sample.setBigInt64(0, BigInt(value), false), - "value " + value); + () => sample.setBigInt64(0, BigInt(value), false), + "value " + value); return; } diff --git a/test/built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js b/test/built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js index 8311d9b3d..760dd8f62 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js +++ b/test/built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js @@ -12,23 +12,23 @@ var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); // False -sample.setBigInt64(0, 1 n); -assert.sameValue(sample.getBigInt64(0), 1 n, "no arg"); -sample.setBigInt64(0, 2 n, undefined); -assert.sameValue(sample.getBigInt64(0), 2 n, "undefined"); -sample.setBigInt64(0, 3 n, null); -assert.sameValue(sample.getBigInt64(0), 3 n, "null"); -sample.setBigInt64(0, 4 n, 0); -assert.sameValue(sample.getBigInt64(0), 4 n, "0"); -sample.setBigInt64(0, 5 n, ""); -assert.sameValue(sample.getBigInt64(0), 5 n, "the empty string"); +sample.setBigInt64(0, 1n); +assert.sameValue(sample.getBigInt64(0), 1n, "no arg"); +sample.setBigInt64(0, 2n, undefined); +assert.sameValue(sample.getBigInt64(0), 2n, "undefined"); +sample.setBigInt64(0, 3n, null); +assert.sameValue(sample.getBigInt64(0), 3n, "null"); +sample.setBigInt64(0, 4n, 0); +assert.sameValue(sample.getBigInt64(0), 4n, "0"); +sample.setBigInt64(0, 5n, ""); +assert.sameValue(sample.getBigInt64(0), 5n, "the empty string"); // True -sample.setBigInt64(0, 6 n, {}); -assert.sameValue(sample.getBigInt64(0), 0x600000000000000 n, "{}"); -sample.setBigInt64(0, 7 n, Symbol("1")); -assert.sameValue(sample.getBigInt64(0), 0x700000000000000 n, "symbol"); -sample.setBigInt64(0, 8 n, 1); -assert.sameValue(sample.getBigInt64(0), 0x800000000000000 n, "1"); -sample.setBigInt64(0, 9 n, "string"); -assert.sameValue(sample.getBigInt64(0), 0x900000000000000 n, "string"); +sample.setBigInt64(0, 6n, {}); +assert.sameValue(sample.getBigInt64(0), 0x600000000000000n, "{}"); +sample.setBigInt64(0, 7n, Symbol("1")); +assert.sameValue(sample.getBigInt64(0), 0x700000000000000n, "symbol"); +sample.setBigInt64(0, 8n, 1); +assert.sameValue(sample.getBigInt64(0), 0x800000000000000n, "1"); +sample.setBigInt64(0, 9n, "string"); +assert.sameValue(sample.getBigInt64(0), 0x900000000000000n, "string"); diff --git a/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js index 169aba7d1..a55f905ae 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js @@ -11,81 +11,73 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); -var obj1 = { - valueOf() { - return 3; - } -}; -var obj2 = { - toString() { - return 4; - } -}; - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(-0, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "-0"); - -sample.setBigInt64(3, 0 n); -sample.setBigInt64(obj1, 42 n); -assert.sameValue(sample.getBigInt64(3), 42 n, "object's valueOf"); - -sample.setBigInt64(4, 0 n); -sample.setBigInt64(obj2, 42 n); -assert.sameValue(sample.getBigInt64(4), 42 n, "object's toString"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64("", 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "the Empty string"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64("0", 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "string '0'"); - -sample.setBigInt64(2, 0 n); -sample.setBigInt64("2", 42 n); -assert.sameValue(sample.getBigInt64(2), 42 n, "string '2'"); - -sample.setBigInt64(1, 0 n); -sample.setBigInt64(true, 42 n); -assert.sameValue(sample.getBigInt64(1), 42 n, "true"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(false, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "false"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(NaN, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "NaN"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(null, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "null"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(0.1, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "0.1"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(0.9, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "0.9"); - -sample.setBigInt64(1, 0 n); -sample.setBigInt64(1.1, 42 n); -assert.sameValue(sample.getBigInt64(1), 42 n, "1.1"); - -sample.setBigInt64(1, 0 n); -sample.setBigInt64(1.9, 42 n); -assert.sameValue(sample.getBigInt64(1), 42 n, "1.9"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(-0.1, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "-0.1"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(-0.99999, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "-0.99999"); - -sample.setBigInt64(0, 0 n); -sample.setBigInt64(undefined, 42 n); -assert.sameValue(sample.getBigInt64(0), 42 n, "undefined"); +var obj1 = { valueOf() { return 3; } }; +var obj2 = { toString() { return 4; } }; + +sample.setBigInt64(0, 0n); +sample.setBigInt64(-0, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "-0"); + +sample.setBigInt64(3, 0n); +sample.setBigInt64(obj1, 42n); +assert.sameValue(sample.getBigInt64(3), 42n, "object's valueOf"); + +sample.setBigInt64(4, 0n); +sample.setBigInt64(obj2, 42n); +assert.sameValue(sample.getBigInt64(4), 42n, "object's toString"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64("", 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "the Empty string"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64("0", 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "string '0'"); + +sample.setBigInt64(2, 0n); +sample.setBigInt64("2", 42n); +assert.sameValue(sample.getBigInt64(2), 42n, "string '2'"); + +sample.setBigInt64(1, 0n); +sample.setBigInt64(true, 42n); +assert.sameValue(sample.getBigInt64(1), 42n, "true"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(false, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "false"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(NaN, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "NaN"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(null, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "null"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(0.1, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "0.1"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(0.9, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "0.9"); + +sample.setBigInt64(1, 0n); +sample.setBigInt64(1.1, 42n); +assert.sameValue(sample.getBigInt64(1), 42n, "1.1"); + +sample.setBigInt64(1, 0n); +sample.setBigInt64(1.9, 42n); +assert.sameValue(sample.getBigInt64(1), 42n, "1.9"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(-0.1, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "-0.1"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(-0.99999, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "-0.99999"); + +sample.setBigInt64(0, 0n); +sample.setBigInt64(undefined, 42n); +assert.sameValue(sample.getBigInt64(0), 42n, "undefined"); diff --git a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js index 0d71d4dfb..f5b45a5ae 100644 --- a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js @@ -106,4 +106,4 @@ assert.sameValue(sample.getInt32(0), 42, "undefined"); sample.setInt32(0, 7); sample.setInt32(); -assert.sameValue(sample.getInt32(0), 0, "no arg"); +assert.sameValue(sample.getInt32(0), 0, "no arg");
\ No newline at end of file |