From fcb520793268b0989785610ffc041a9649ea9c0a Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 13:26:50 -0400 Subject: [PATCH 1/7] BigInt: fix test sortcompare does not call toString --- .../prototype/sort/BigInt/sortcompare-with-no-tostring.js | 6 +++++- .../prototype/sort/sortcompare-with-no-tostring.js | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js b/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js index 3f6402c667..f588b36bcc 100644 --- a/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js +++ b/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js @@ -18,10 +18,14 @@ includes: [testBigIntTypedArray.js, compareArray.js] features: [BigInt, TypedArray] ---*/ -var origToString = Number.prototype.toString; +var toStringCalled = false; +BigInt.prototype.toString = function() { + toStringCalled = true; +} testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA([20n, 100n, 3n]); var result = sample.sort(); + assert.sameValue(toStringCalled, false, "BigInt.prototype.toString will not be called"); assert(compareArray(result, [3n, 20n, 100n])); }); diff --git a/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js b/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js index f3bb0cac03..591c9087b0 100644 --- a/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js +++ b/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js @@ -18,10 +18,14 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -var origToString = Number.prototype.toString; +var toStringCalled = false; +Number.prototype.toString = function() { + toStringCalled = true; +} testWithTypedArrayConstructors(function(TA) { var sample = new TA([20, 100, 3]); var result = sample.sort(); - assert(compareArray(result, [3, 20, 100])); + assert.sameValue(toStringCalled, false, "Number.prototype.toString will not be called"); + assert(compareArray(result, [3, 20, 100]), "Default sorting by value"); }); From a9827c945dcf0c170008adf85f3685e557897569 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 13:47:29 -0400 Subject: [PATCH 2/7] BigInt: fix TypedArray fncs expecting BigInt for cmp --- .../prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js | 2 +- .../fill/BigInt/return-abrupt-from-start-as-symbol.js | 2 +- .../TypedArray/prototype/includes/BigInt/detached-buffer.js | 2 +- .../BigInt/fromIndex-equal-or-greater-length-returns-false.js | 4 ++-- .../prototype/includes/BigInt/length-zero-returns-false.js | 2 +- .../TypedArray/prototype/indexOf/BigInt/detached-buffer.js | 2 +- .../fromIndex-equal-or-greater-length-returns-minus-one.js | 4 ++-- .../prototype/indexOf/BigInt/length-zero-returns-minus-one.js | 4 ++-- .../BigInt/return-abrupt-tointeger-fromindex-symbol.js | 2 +- .../indexOf/BigInt/return-abrupt-tointeger-fromindex.js | 2 +- .../prototype/lastIndexOf/BigInt/detached-buffer.js | 2 +- .../lastIndexOf/BigInt/length-zero-returns-minus-one.js | 2 +- .../BigInt/return-abrupt-tointeger-fromindex-symbol.js | 2 +- .../lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js b/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js index 084c9ac1e7..69ad955b68 100644 --- a/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js +++ b/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js @@ -33,6 +33,6 @@ var end = Symbol(1); testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(); assert.throws(TypeError, function() { - sample.fill(1, 0, end); + sample.fill(1n, 0, end); }); }); diff --git a/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start-as-symbol.js b/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start-as-symbol.js index d95c9a30d8..73c2417867 100644 --- a/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start-as-symbol.js +++ b/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start-as-symbol.js @@ -32,6 +32,6 @@ var start = Symbol(1); testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(); assert.throws(TypeError, function() { - sample.fill(1, start); + sample.fill(1n, start); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js index 990e4b01a8..0239cca34a 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js @@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { - sample.includes(0); + sample.includes(0n); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-equal-or-greater-length-returns-false.js b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-equal-or-greater-length-returns-false.js index a59b7084a5..a36d4d415b 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-equal-or-greater-length-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-equal-or-greater-length-returns-false.js @@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample; sample = new TA(42); - assert.sameValue(sample.includes(0, 42), false); - assert.sameValue(sample.includes(0, 43), false); + assert.sameValue(sample.includes(0n, 42), false); + assert.sameValue(sample.includes(0n, 43), false); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js b/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js index 9c06fa6c1d..1ceaa37bc9 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js @@ -33,7 +33,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(sample.includes(0), false, "returns false"); assert.sameValue(sample.includes(), false, "returns false - no arg"); assert.sameValue( - sample.includes(0, fromIndex), false, + sample.includes(0n, fromIndex), false, "length is checked before ToInteger(fromIndex)" ); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js index 1d44ab16d8..757baf77c7 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js @@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { - sample.indexOf(0); + sample.indexOf(0n); }); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-equal-or-greater-length-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-equal-or-greater-length-returns-minus-one.js index 022f4a1567..a7bc3e50a0 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-equal-or-greater-length-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-equal-or-greater-length-returns-minus-one.js @@ -25,6 +25,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample; sample = new TA(42); - assert.sameValue(sample.indexOf(0, 42), -1); - assert.sameValue(sample.indexOf(0, 43), -1); + assert.sameValue(sample.indexOf(0n, 42), -1); + assert.sameValue(sample.indexOf(0n, 43), -1); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js index 510a58f7bb..2c679e4914 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js @@ -29,9 +29,9 @@ var fromIndex = { testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(); - assert.sameValue(sample.indexOf(0), -1, "returns -1"); + assert.sameValue(sample.indexOf(0n), -1, "returns -1"); assert.sameValue( - sample.indexOf(0, fromIndex), -1, + sample.indexOf(0n, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js index 843a22a29c..a4e3dfccbc 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js @@ -27,6 +27,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); assert.throws(TypeError, function() { - sample.indexOf(7, fromIndex); + sample.indexOf(7n, fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex.js index 751b482b93..f5063efa06 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex.js @@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); assert.throws(Test262Error, function() { - sample.indexOf(7, fromIndex); + sample.indexOf(7n, fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js index 616f96ce5a..70e471654c 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js @@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { - sample.lastIndexOf(0); + sample.lastIndexOf(0n); }); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js index 07fc5da726..9676e2d5df 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js @@ -31,7 +31,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(); assert.sameValue(sample.lastIndexOf(0), -1, "returns -1"); assert.sameValue( - sample.lastIndexOf(0, fromIndex), -1, + sample.lastIndexOf(0n, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js index 67c1ea4c62..5f4f01d63d 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js @@ -27,6 +27,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); assert.throws(TypeError, function() { - sample.lastIndexOf(7, fromIndex); + sample.lastIndexOf(7n, fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js index 2f3465b343..ca2eb82d71 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js @@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); assert.throws(Test262Error, function() { - sample.lastIndexOf(7, fromIndex); + sample.lastIndexOf(7n, fromIndex); }); }); From 07fdc340a4d9bb6276507d630b6b8ddc62f82021 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 14:37:15 -0400 Subject: [PATCH 3/7] BigInt: fix make buffer size BYTES_PER_ELEMENT --- .../buffer-arg/invoked-with-undefined-newtarget-sab.js | 2 +- .../ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget-sab.js b/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget-sab.js index 10f1c12faf..4b242832d9 100644 --- a/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget-sab.js +++ b/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget-sab.js @@ -20,7 +20,7 @@ features: [BigInt, SharedArrayBuffer, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var buffer = new SharedArrayBuffer(4); + var buffer = new SharedArrayBuffer(TA.BYTES_PER_ELEMENT); assert.throws(TypeError, function() { TA(buffer); }); diff --git a/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js b/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js index c746dc1889..623c193af7 100644 --- a/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js +++ b/test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js @@ -19,7 +19,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(4); + var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT); assert.throws(TypeError, function() { TA(buffer); }); From 7c857318f0ce09778038f409875b1e3de8fe27dc Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 14:53:06 -0400 Subject: [PATCH 4/7] BigInt: fix, other TypedArray should be Big --- .../typedarray-arg/other-ctor-buffer-ctor-access-throws.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-access-throws.js b/test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-access-throws.js index 686c020080..3882f1c78e 100644 --- a/test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-access-throws.js +++ b/test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-access-throws.js @@ -26,7 +26,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var OtherCtor = TA === Int8Array ? Int16Array : Int8Array; + var OtherCtor = TA === BigInt64Array ? BigUint64Array : BigInt64Array; var sample = new OtherCtor(); Object.defineProperty(sample.buffer, "constructor", { From 324c18038bceee988f5c49e80e25dd9ea8811a89 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 14:58:43 -0400 Subject: [PATCH 5/7] BigInt: fix input values to be type BigInt --- .../from/BigInt/custom-ctor-returns-smaller-instance-throws.js | 2 +- .../from/BigInt/mapfn-abrupt-completion.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-smaller-instance-throws.js b/test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-smaller-instance-throws.js index 8c2a128d0c..2726aac565 100644 --- a/test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-smaller-instance-throws.js +++ b/test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-smaller-instance-throws.js @@ -22,7 +22,7 @@ includes: [testBigIntTypedArray.js] features: [BigInt, Symbol.iterator, TypedArray] ---*/ -var sourceItor = [1, 2]; +var sourceItor = [1n, 2n]; var sourceObj = { length: 2 }; diff --git a/test/built-ins/TypedArrayConstructors/from/BigInt/mapfn-abrupt-completion.js b/test/built-ins/TypedArrayConstructors/from/BigInt/mapfn-abrupt-completion.js index 4efbf68faa..82bdcadf3f 100644 --- a/test/built-ins/TypedArrayConstructors/from/BigInt/mapfn-abrupt-completion.js +++ b/test/built-ins/TypedArrayConstructors/from/BigInt/mapfn-abrupt-completion.js @@ -18,7 +18,7 @@ features: [BigInt, TypedArray] ---*/ var source = { - "0": 42, + "0": 42n, length: 2 }; var mapfn = function() { From 3f96092cb90ab5eacb6308a83f5b60c4eb1a19b6 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 15:06:12 -0400 Subject: [PATCH 6/7] BigInt: fix, set only BigInts to index to avoid false negatives --- .../DefineOwnProperty/BigInt/detached-buffer-realm.js | 2 +- .../DefineOwnProperty/BigInt/detached-buffer.js | 2 +- .../BigInt/key-is-greater-than-last-index.js | 4 ++-- .../DefineOwnProperty/BigInt/key-is-lower-than-zero.js | 2 +- .../DefineOwnProperty/BigInt/key-is-minus-zero.js | 2 +- .../DefineOwnProperty/BigInt/key-is-not-integer.js | 10 +++++----- .../BigInt/key-is-numericindex-desc-configurable.js | 2 +- .../BigInt/key-is-numericindex-desc-not-enumerable.js | 2 +- .../BigInt/key-is-numericindex-desc-not-writable.js | 2 +- .../internals/Set/BigInt/detached-buffer-realm.js | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js index 3fa462103a..52d2ad0950 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js @@ -29,7 +29,7 @@ features: [BigInt, cross-realm, Reflect, TypedArray] var other = $262.createRealm().global; var desc = { - value: 0, + value: 0n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js index f201761566..17417b995d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js @@ -27,7 +27,7 @@ features: [BigInt, Reflect, TypedArray] ---*/ var desc = { - value: 0, + value: 0n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js index c558041e15..3177065146 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js @@ -25,7 +25,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "2", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true @@ -36,7 +36,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "3", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js index c9ff538985..b2afcf4853 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js @@ -23,7 +23,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "-1", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js index 73dcde780b..a45c75dbe4 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js @@ -23,7 +23,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "-0", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js index 15bc69fb42..e4a90f0ec5 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js @@ -21,7 +21,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "0.1", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true @@ -38,7 +38,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "0.000001", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true @@ -58,7 +58,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "1.1", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true @@ -75,7 +75,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "Infinity", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true @@ -99,7 +99,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "-Infinity", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js index 51fd77203b..59b5abd434 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js @@ -23,7 +23,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "0", { - value: 42, + value: 42n, configurable: true, enumerable: true, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js index 37315f7c98..4b46693b01 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js @@ -23,7 +23,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "0", { - value: 42, + value: 42n, configurable: false, enumerable: false, writable: true diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js index 26f4363fec..8e7bdf4d56 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js @@ -23,7 +23,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, "0", { - value: 42, + value: 42n, configurable: false, enumerable: true, writable: false diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-realm.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-realm.js index f7e71ff0eb..f5e15d83eb 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-realm.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-realm.js @@ -35,6 +35,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { - sample[0] = 0; + sample[0] = 0n; }); }); From cc866293013b6c700a21ef55de6d113209f83251 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 13 Mar 2018 15:23:39 -0400 Subject: [PATCH 7/7] BigInt: fix, make sure to correctly use different typedarray ctor --- .../typedarray-arg-set-values-diff-buffer-other-type-sab.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js index 344aceeda0..3145bc8075 100644 --- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js +++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js @@ -13,7 +13,8 @@ features: [BigInt, SharedArrayBuffer, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sab = new SharedArrayBuffer(2 * BigInt64Array.BYTES_PER_ELEMENT); - var src = new BigInt64Array(sab); + var otherCtor = TA === BigInt64Array ? BigUint64Array : BigInt64Array; + var src = new otherCtor(sab); src[0] = 42n; src[1] = 43n; var sample, result;