diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js')
-rw-r--r-- | js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js | 42 |
1 files changed, 42 insertions, 0 deletions
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); |