diff --git a/test/built-ins/Array/prototype/every/resizable-buffer-grow-mid-iteration.js b/test/built-ins/Array/prototype/every/resizable-buffer-grow-mid-iteration.js index b81faefa79..06065534ac 100644 --- a/test/built-ins/Array/prototype/every/resizable-buffer-grow-mid-iteration.js +++ b/test/built-ins/Array/prototype/every/resizable-buffer-grow-mid-iteration.js @@ -10,11 +10,19 @@ includes: [compareArray.js, resizableArrayBufferUtils.js] features: [resizable-arraybuffer] ---*/ -const ArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { - return Array.prototype.every.call( - ta, - (n) => CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo)); -}; +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} // Orig. array: [0, 2, 4, 6] // [0, 2, 4, 6] << fixedLength @@ -22,12 +30,12 @@ const ArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { // [0, 2, 4, 6, ...] << lengthTracking // [4, 6, ...] << lengthTrackingWithOffset for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLength = new ctor(rab, 0, 4); - const values = []; - const resizeAfter = 2; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(fixedLength, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(fixedLength, ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -36,24 +44,24 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLengthWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT, 2); - const values = []; - const resizeAfter = 1; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(fixedLengthWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(fixedLengthWithOffset, ResizeBufferMidIteration)); assert.compareArray(values, [ 4, 6 ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTracking = new ctor(rab, 0); - const values = []; - const resizeAfter = 2; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(lengthTracking, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(lengthTracking, ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -62,12 +70,12 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTrackingWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT); - const values = []; - const resizeAfter = 1; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(lengthTrackingWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(lengthTrackingWithOffset, ResizeBufferMidIteration)); assert.compareArray(values, [ 4, 6 diff --git a/test/built-ins/Array/prototype/every/resizable-buffer-shrink-mid-iteration.js b/test/built-ins/Array/prototype/every/resizable-buffer-shrink-mid-iteration.js index 5987d46e84..4b4866ce89 100644 --- a/test/built-ins/Array/prototype/every/resizable-buffer-shrink-mid-iteration.js +++ b/test/built-ins/Array/prototype/every/resizable-buffer-shrink-mid-iteration.js @@ -10,11 +10,19 @@ includes: [compareArray.js, resizableArrayBufferUtils.js] features: [resizable-arraybuffer] ---*/ -const ArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { - return Array.prototype.every.call( - ta, - (n) => CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo)); -}; +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} // Orig. array: [0, 2, 4, 6] // [0, 2, 4, 6] << fixedLength @@ -22,33 +30,33 @@ const ArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { // [0, 2, 4, 6, ...] << lengthTracking // [4, 6, ...] << lengthTrackingWithOffset for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLength = new ctor(rab, 0, 4); - const values = []; - const resizeAfter = 2; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(fixedLength, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(fixedLength, ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2 ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLengthWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT, 2); - const values = []; - const resizeAfter = 1; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(fixedLengthWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(fixedLengthWithOffset, ResizeBufferMidIteration)); assert.compareArray(values, [4]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTracking = new ctor(rab, 0); - const values = []; - const resizeAfter = 2; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(lengthTracking, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(lengthTracking, ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -56,11 +64,11 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTrackingWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT); - const values = []; - const resizeAfter = 1; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(ArrayEveryHelper(lengthTrackingWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(Array.prototype.every.call(lengthTrackingWithOffset, ResizeBufferMidIteration)); assert.compareArray(values, [4]); } diff --git a/test/built-ins/Array/prototype/every/resizable-buffer.js b/test/built-ins/Array/prototype/every/resizable-buffer.js index c123a6bcf4..818cb006f9 100644 --- a/test/built-ins/Array/prototype/every/resizable-buffer.js +++ b/test/built-ins/Array/prototype/every/resizable-buffer.js @@ -10,9 +10,19 @@ includes: [resizableArrayBufferUtils.js ] features: [resizable-arraybuffer] ---*/ -const ArrayEveryHelper = (ta, ...rest) => { - return Array.prototype.every.call(ta, ...rest); -}; +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} for (let ctor of ctors) { const rab = CreateResizableArrayBuffer(4 * ctor.BYTES_PER_ELEMENT, 8 * ctor.BYTES_PER_ELEMENT); @@ -42,14 +52,14 @@ for (let ctor of ctors) { function over10(n) { return Number(n) > 10; } - assert(!ArrayEveryHelper(fixedLength, div3)); - assert(ArrayEveryHelper(fixedLength, even)); - assert(!ArrayEveryHelper(fixedLengthWithOffset, div3)); - assert(ArrayEveryHelper(fixedLengthWithOffset, even)); - assert(!ArrayEveryHelper(lengthTracking, div3)); - assert(ArrayEveryHelper(lengthTracking, even)); - assert(!ArrayEveryHelper(lengthTrackingWithOffset, div3)); - assert(ArrayEveryHelper(lengthTrackingWithOffset, even)); + assert(!Array.prototype.every.call(fixedLength, div3)); + assert(Array.prototype.every.call(fixedLength, even)); + assert(!Array.prototype.every.call(fixedLengthWithOffset, div3)); + assert(Array.prototype.every.call(fixedLengthWithOffset, even)); + assert(!Array.prototype.every.call(lengthTracking, div3)); + assert(Array.prototype.every.call(lengthTracking, even)); + assert(!Array.prototype.every.call(lengthTrackingWithOffset, div3)); + assert(Array.prototype.every.call(lengthTrackingWithOffset, even)); // Shrink so that fixed length TAs go out of bounds. rab.resize(3 * ctor.BYTES_PER_ELEMENT); @@ -59,33 +69,33 @@ for (let ctor of ctors) { // [4, ...] << lengthTrackingWithOffset // Calling .every on an out of bounds TA doesn't throw. - assert(ArrayEveryHelper(fixedLength, div3)); - assert(ArrayEveryHelper(fixedLengthWithOffset, div3)); + assert(Array.prototype.every.call(fixedLength, div3)); + assert(Array.prototype.every.call(fixedLengthWithOffset, div3)); - assert(!ArrayEveryHelper(lengthTracking, div3)); - assert(ArrayEveryHelper(lengthTracking, even)); - assert(!ArrayEveryHelper(lengthTrackingWithOffset, div3)); - assert(ArrayEveryHelper(lengthTrackingWithOffset, even)); + assert(!Array.prototype.every.call(lengthTracking, div3)); + assert(Array.prototype.every.call(lengthTracking, even)); + assert(!Array.prototype.every.call(lengthTrackingWithOffset, div3)); + assert(Array.prototype.every.call(lengthTrackingWithOffset, even)); // Shrink so that the TAs with offset go out of bounds. rab.resize(1 * ctor.BYTES_PER_ELEMENT); // Calling .every on an out of bounds TA doesn't throw. - assert(ArrayEveryHelper(fixedLength, div3)); - assert(ArrayEveryHelper(fixedLengthWithOffset, div3)); - assert(ArrayEveryHelper(lengthTrackingWithOffset, div3)); + assert(Array.prototype.every.call(fixedLength, div3)); + assert(Array.prototype.every.call(fixedLengthWithOffset, div3)); + assert(Array.prototype.every.call(lengthTrackingWithOffset, div3)); - assert(ArrayEveryHelper(lengthTracking, div3)); - assert(ArrayEveryHelper(lengthTracking, even)); + assert(Array.prototype.every.call(lengthTracking, div3)); + assert(Array.prototype.every.call(lengthTracking, even)); // Shrink to zero. rab.resize(0); // Calling .every on an out of bounds TA doesn't throw. - assert(ArrayEveryHelper(fixedLength, div3)); - assert(ArrayEveryHelper(fixedLengthWithOffset, div3)); - assert(ArrayEveryHelper(lengthTrackingWithOffset, div3)); + assert(Array.prototype.every.call(fixedLength, div3)); + assert(Array.prototype.every.call(fixedLengthWithOffset, div3)); + assert(Array.prototype.every.call(lengthTrackingWithOffset, div3)); - assert(ArrayEveryHelper(lengthTracking, div3)); - assert(ArrayEveryHelper(lengthTracking, even)); + assert(Array.prototype.every.call(lengthTracking, div3)); + assert(Array.prototype.every.call(lengthTracking, even)); // Grow so that all TAs are back in-bounds. rab.resize(6 * ctor.BYTES_PER_ELEMENT); @@ -99,12 +109,12 @@ for (let ctor of ctors) { // [0, 2, 4, 6, 8, 10, ...] << lengthTracking // [4, 6, 8, 10, ...] << lengthTrackingWithOffset - assert(!ArrayEveryHelper(fixedLength, div3)); - assert(ArrayEveryHelper(fixedLength, even)); - assert(!ArrayEveryHelper(fixedLengthWithOffset, div3)); - assert(ArrayEveryHelper(fixedLengthWithOffset, even)); - assert(!ArrayEveryHelper(lengthTracking, div3)); - assert(ArrayEveryHelper(lengthTracking, even)); - assert(!ArrayEveryHelper(lengthTrackingWithOffset, div3)); - assert(ArrayEveryHelper(lengthTrackingWithOffset, even)); + assert(!Array.prototype.every.call(fixedLength, div3)); + assert(Array.prototype.every.call(fixedLength, even)); + assert(!Array.prototype.every.call(fixedLengthWithOffset, div3)); + assert(Array.prototype.every.call(fixedLengthWithOffset, even)); + assert(!Array.prototype.every.call(lengthTracking, div3)); + assert(Array.prototype.every.call(lengthTracking, even)); + assert(!Array.prototype.every.call(lengthTrackingWithOffset, div3)); + assert(Array.prototype.every.call(lengthTrackingWithOffset, even)); } diff --git a/test/built-ins/TypedArray/prototype/every/resizable-buffer-grow-mid-iteration.js b/test/built-ins/TypedArray/prototype/every/resizable-buffer-grow-mid-iteration.js index d7ca969098..29cf537bec 100644 --- a/test/built-ins/TypedArray/prototype/every/resizable-buffer-grow-mid-iteration.js +++ b/test/built-ins/TypedArray/prototype/every/resizable-buffer-grow-mid-iteration.js @@ -10,10 +10,19 @@ includes: [compareArray.js, resizableArrayBufferUtils.js] features: [resizable-arraybuffer] ---*/ -const TypedArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { - return ta.every( - (n) => CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo)); -}; +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} // Orig. array: [0, 2, 4, 6] // [0, 2, 4, 6] << fixedLength @@ -21,12 +30,12 @@ const TypedArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { // [0, 2, 4, 6, ...] << lengthTracking // [4, 6, ...] << lengthTrackingWithOffset for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLength = new ctor(rab, 0, 4); - const values = []; - const resizeAfter = 2; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(fixedLength, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(fixedLength.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -35,24 +44,24 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLengthWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT, 2); - const values = []; - const resizeAfter = 1; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(fixedLengthWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(fixedLengthWithOffset.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 4, 6 ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTracking = new ctor(rab, 0); - const values = []; - const resizeAfter = 2; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(lengthTracking, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(lengthTracking.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -61,12 +70,12 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTrackingWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT); - const values = []; - const resizeAfter = 1; - const resizeTo = 5 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(lengthTrackingWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 5 * ctor.BYTES_PER_ELEMENT; + assert(lengthTrackingWithOffset.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 4, 6 diff --git a/test/built-ins/TypedArray/prototype/every/resizable-buffer-shrink-mid-iteration.js b/test/built-ins/TypedArray/prototype/every/resizable-buffer-shrink-mid-iteration.js index 5e5412f768..573e21b386 100644 --- a/test/built-ins/TypedArray/prototype/every/resizable-buffer-shrink-mid-iteration.js +++ b/test/built-ins/TypedArray/prototype/every/resizable-buffer-shrink-mid-iteration.js @@ -10,24 +10,32 @@ includes: [compareArray.js, resizableArrayBufferUtils.js] features: [resizable-arraybuffer] ---*/ -const TypedArrayEveryHelper = (ta, values, rab, resizeAfter, resizeTo) => { - return ta.every( - (n) => CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo)); -}; +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} // Orig. array: [0, 2, 4, 6] // [0, 2, 4, 6] << fixedLength // [4, 6] << fixedLengthWithOffset // [0, 2, 4, 6, ...] << lengthTracking // [4, 6, ...] << lengthTrackingWithOffset - for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLength = new ctor(rab, 0, 4); - const values = []; - const resizeAfter = 2; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(fixedLength, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(fixedLength.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -36,24 +44,24 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const fixedLengthWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT, 2); - const values = []; - const resizeAfter = 1; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(fixedLengthWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(fixedLengthWithOffset.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 4, undefined ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTracking = new ctor(rab, 0); - const values = []; - const resizeAfter = 2; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(lengthTracking, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 2; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(lengthTracking.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 0, 2, @@ -62,12 +70,12 @@ for (let ctor of ctors) { ]); } for (let ctor of ctors) { - const rab = CreateRabForTest(ctor); + rab = CreateRabForTest(ctor); const lengthTrackingWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT); - const values = []; - const resizeAfter = 1; - const resizeTo = 3 * ctor.BYTES_PER_ELEMENT; - assert(TypedArrayEveryHelper(lengthTrackingWithOffset, values, rab, resizeAfter, resizeTo)); + values = []; + resizeAfter = 1; + resizeTo = 3 * ctor.BYTES_PER_ELEMENT; + assert(lengthTrackingWithOffset.every(ResizeBufferMidIteration)); assert.compareArray(values, [ 4, undefined diff --git a/test/built-ins/TypedArray/prototype/every/resizable-buffer.js b/test/built-ins/TypedArray/prototype/every/resizable-buffer.js index 22369d6271..6da38a9309 100644 --- a/test/built-ins/TypedArray/prototype/every/resizable-buffer.js +++ b/test/built-ins/TypedArray/prototype/every/resizable-buffer.js @@ -10,6 +10,20 @@ includes: [resizableArrayBufferUtils.js] features: [resizable-arraybuffer] ---*/ +let values; +let rab; +let resizeAfter; +let resizeTo; +// Collects the view of the resizable array buffer "rab" into "values", with an +// iteration during which, after "resizeAfter" steps, "rab" is resized to length +// "resizeTo". To be called by a method of the view being collected. +// Note that "rab", "values", "resizeAfter", and "resizeTo" may need to be reset +// before calling this. +function ResizeBufferMidIteration(n) { + // Returns true by default. + return CollectValuesAndResize(n, values, rab, resizeAfter, resizeTo); +} + for (let ctor of ctors) { const rab = CreateResizableArrayBuffer(4 * ctor.BYTES_PER_ELEMENT, 8 * ctor.BYTES_PER_ELEMENT); const fixedLength = new ctor(rab, 0, 4);