From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- ...or-result-from-tostring-on-each-simple-value.js | 1 + ...separator-result-from-tostring-on-each-value.js | 1 + ...buffer-during-fromIndex-returns-single-comma.js | 1 + .../TypedArray/prototype/join/detached-buffer.js | 1 + .../prototype/join/empty-instance-empty-string.js | 1 + .../join/get-length-uses-internal-arraylength.js | 1 + .../TypedArray/prototype/join/invoked-as-func.js | 1 + .../TypedArray/prototype/join/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/join/length.js | 12 ++++--- .../built-ins/TypedArray/prototype/join/name.js | 12 ++++--- .../TypedArray/prototype/join/not-a-constructor.js | 3 +- .../TypedArray/prototype/join/prop-desc.js | 1 + .../result-from-tostring-on-each-simple-value.js | 1 + .../join/result-from-tostring-on-each-value.js | 1 + .../join/return-abrupt-from-separator-symbol.js | 1 + .../prototype/join/return-abrupt-from-separator.js | 1 + .../join/return-abrupt-from-this-out-of-bounds.js | 2 +- .../join/separator-tostring-once-after-resized.js | 42 ++++++++++++++++++++++ .../prototype/join/this-is-not-object.js | 1 + .../join/this-is-not-typedarray-instance.js | 1 + 20 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js (limited to 'js/src/tests/test262/built-ins/TypedArray/prototype/join') diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js index 319f85e9c2..87bf1f9d1d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js index 02235e1b35..1a8fb0cd45 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js index 660c1e497d..2f58359eb8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js index a78b14a226..8f622b9ed0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js index 54e40f5194..4f313db82f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js index 95b4bac090..f1e537bed4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js index 035a040719..4c94418800 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js index d57a9cd0b3..71ccf3d9b0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js index 2ba19e6f94..e9c10e5e8d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.join.length, 1); - -verifyNotEnumerable(TypedArray.prototype.join, "length"); -verifyNotWritable(TypedArray.prototype.join, "length"); -verifyConfigurable(TypedArray.prototype.join, "length"); +verifyProperty(TypedArray.prototype.join, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js index df6cec6248..b2ac1d73a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.join.name, "join"); - -verifyNotEnumerable(TypedArray.prototype.join, "name"); -verifyNotWritable(TypedArray.prototype.join, "name"); -verifyConfigurable(TypedArray.prototype.join, "name"); +verifyProperty(TypedArray.prototype.join, "name", { + value: "join", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js index 7ab017fbf1..338879aeb8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.join(); -}, '`let u8 = new Uint8Array(1); new u8.join()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js index c42df0790b..16e0808b53 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js index 9a21ff741a..8582f05ca6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js index 082e482b9f..1e8030a9a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js index ce5ad17b4b..76994aadad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js index a530a4714b..2c3a345c96 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js index 45fe1e5e23..e93b479442 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js new file mode 100644 index 0000000000..fdae9040c5 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js @@ -0,0 +1,42 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.prototype.join +description: > + ToString is called once when the array is resized. +info: | + %TypedArray%.prototype.join ( separator ) + + ... + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + ... + 5. Else, let sep be ? ToString(separator). + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let ta = new Int8Array(rab); + +let callCount = 0; + +let index = { + toString() { + callCount++; + rab.resize(0); + return "-"; + } +}; + +assert.sameValue(callCount, 0); + +let r = ta.join(index); + +assert.sameValue(callCount, 1); +assert.sameValue(r, "--"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js index ff4ef67fd1..10bae4ba82 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js index 926c39a97e..16925a33a1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -- cgit v1.2.3