1 // |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 André Bargull. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-%typedarray%.prototype.join
8 ToString is called once when the array is resized.
10 %TypedArray%.prototype.join ( separator )
13 2. Let taRecord be ? ValidateTypedArray(O, seq-cst).
14 3. Let len be TypedArrayLength(taRecord).
16 5. Else, let sep be ? ToString(separator).
19 features: [TypedArray, resizable-arraybuffer]
22 let rab = new ArrayBuffer(3, {maxByteLength: 5});
23 let ta = new Int8Array(rab);
35 assert.sameValue(callCount, 0);
37 let r = ta.join(index);
39 assert.sameValue(callCount, 1);
40 assert.sameValue(r, "--");