From 088d37632150d385e646a477af695fb8dae3ade3 Mon Sep 17 00:00:00 2001 From: anivar Date: Sat, 29 Nov 2025 20:33:50 +0000 Subject: [PATCH 1/7] Implement ES2024 Resizable ArrayBuffer Adds support for resizable ArrayBuffers as specified in ES2024. Constructor accepts optional maxByteLength parameter: new ArrayBuffer(length, { maxByteLength }) New resize() method allows in-place buffer resizing: - Grows or shrinks buffer up to maxByteLength - Preserves existing data, zeros new bytes - Throws TypeError if not resizable or detached - Throws RangeError if exceeds maxByteLength New properties: - resizable: true if buffer has maxByteLength - maxByteLength: maximum size (equals byteLength for fixed-length) Includes 22 comprehensive tests covering all functionality and edge cases. All tests passing. --- .../typedarrays/NativeArrayBuffer.java | 141 +++++++++- .../es2024/ResizableArrayBufferTest.java | 261 ++++++++++++++++++ 2 files changed, 401 insertions(+), 1 deletion(-) create mode 100644 tests/src/test/java/org/mozilla/javascript/tests/es2024/ResizableArrayBufferTest.java diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java index 94ee443a88..77a700ace8 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java @@ -29,6 +29,8 @@ public class NativeArrayBuffer extends ScriptableObject { private static final byte[] EMPTY_BUF = new byte[0]; byte[] buffer; + // ES2024: maxByteLength for resizable buffers (null = fixed-length) + private Integer maxByteLength; @Override public String getClassName() { @@ -50,8 +52,12 @@ public static Object init(Context cx, Scriptable scope, boolean sealed) { constructor.definePrototypeMethod(scope, "transfer", 0, NativeArrayBuffer::js_transfer); constructor.definePrototypeMethod( scope, "transferToFixedLength", 0, NativeArrayBuffer::js_transferToFixedLength); + constructor.definePrototypeMethod(scope, "resize", 1, NativeArrayBuffer::js_resize); constructor.definePrototypeProperty(cx, "byteLength", NativeArrayBuffer::js_byteLength); constructor.definePrototypeProperty(cx, "detached", NativeArrayBuffer::js_detached); + constructor.definePrototypeProperty(cx, "resizable", NativeArrayBuffer::js_resizable); + constructor.definePrototypeProperty( + cx, "maxByteLength", NativeArrayBuffer::js_maxByteLength); constructor.definePrototypeProperty( SymbolKey.TO_STRING_TAG, "ArrayBuffer", DONTENUM | READONLY); @@ -144,7 +150,41 @@ private static NativeArrayBuffer getSelf(Scriptable thisObj) { private static NativeArrayBuffer js_constructor(Context cx, Scriptable scope, Object[] args) { double length = isArg(args, 0) ? ScriptRuntime.toNumber(args[0]) : 0; - return new NativeArrayBuffer(length); + + // ES2024: Check for options parameter with maxByteLength + Integer maxByteLength = null; + if (isArg(args, 1) && args[1] instanceof Scriptable) { + Scriptable options = (Scriptable) args[1]; + Object maxByteLengthValue = ScriptableObject.getProperty(options, "maxByteLength"); + if (maxByteLengthValue != Scriptable.NOT_FOUND + && !Undefined.instance.equals(maxByteLengthValue)) { + double maxLen = ScriptRuntime.toNumber(maxByteLengthValue); + + // Validate maxByteLength + if (Double.isNaN(maxLen)) { + maxLen = 0; + } + if (maxLen < 0 || Double.isInfinite(maxLen)) { + throw ScriptRuntime.rangeError("Invalid maxByteLength"); + } + if (maxLen >= Integer.MAX_VALUE) { + throw ScriptRuntime.rangeError("maxByteLength too large"); + } + + int maxLenInt = (int) maxLen; + + // Check that length <= maxByteLength + if (length > maxLenInt) { + throw ScriptRuntime.rangeError("ArrayBuffer length exceeds maxByteLength"); + } + + maxByteLength = maxLenInt; + } + } + + NativeArrayBuffer buffer = new NativeArrayBuffer(length); + buffer.maxByteLength = maxByteLength; + return buffer; } private static Boolean js_isView( @@ -352,4 +392,103 @@ private static int validateNewByteLength(Object[] args, int defaultLength) { return (int) newLength; } + + // ES2024 ArrayBuffer.prototype.resize + private static Object js_resize( + Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { + NativeArrayBuffer self = getSelf(thisObj); + + // 1. Let O be the this value + // 2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]) + // (getSelf handles this validation) + + // 3. If IsDetachedBuffer(O) is true, throw a TypeError exception + if (self.isDetached()) { + throw ScriptRuntime.typeErrorById("msg.arraybuf.detached"); + } + + // 4. If IsResizableArrayBuffer(O) is false, throw a TypeError exception + if (self.maxByteLength == null) { + throw ScriptRuntime.typeError("ArrayBuffer is not resizable"); + } + + // 5. Let newByteLength be ? ToIntegerOrInfinity(newLength) + if (!isArg(args, 0)) { + throw ScriptRuntime.typeError("Missing required argument: newLength"); + } + + double newLengthDouble = ScriptRuntime.toNumber(args[0]); + + // ToIntegerOrInfinity: Handle NaN (convert to 0) + if (Double.isNaN(newLengthDouble)) { + newLengthDouble = 0; + } + + // 6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]], throw a + // RangeError exception + if (newLengthDouble < 0 || Double.isInfinite(newLengthDouble)) { + throw ScriptRuntime.rangeError("Invalid newLength"); + } + + if (newLengthDouble >= Integer.MAX_VALUE) { + throw ScriptRuntime.rangeError("newLength too large"); + } + + int newLength = (int) newLengthDouble; + + if (newLength > self.maxByteLength) { + throw ScriptRuntime.rangeError( + "newLength exceeds maxByteLength (" + self.maxByteLength + ")"); + } + + // 7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength) + // 8. If hostHandled is handled, return undefined + // 9. Let oldBlock be O.[[ArrayBufferData]] + // 10. Let newBlock be ? CreateByteDataBlock(newByteLength) + // 11. Let copyLength be min(newByteLength, O.[[ArrayBufferByteLength]]) + // 12. Perform CopyDataBlockBytes(newBlock, 0, oldBlock, 0, copyLength) + // 13. NOTE: Neither creation of the new Data Block nor copying from the old Data Block + // are observable + // 14. Set O.[[ArrayBufferData]] to newBlock + // 15. Set O.[[ArrayBufferByteLength]] to newByteLength + + int oldLength = self.getLength(); + if (newLength == oldLength) { + // No resize needed + return Undefined.instance; + } + + byte[] newBuffer = new byte[newLength]; + int copyLength = Math.min(newLength, oldLength); + + // Copy existing data + if (copyLength > 0) { + System.arraycopy(self.buffer, 0, newBuffer, 0, copyLength); + } + + // New bytes are automatically initialized to 0 in Java + self.buffer = newBuffer; + + // 16. Return undefined + return Undefined.instance; + } + + // ES2024 ArrayBuffer.prototype.resizable getter + private static Object js_resizable(Scriptable thisObj) { + NativeArrayBuffer self = getSelf(thisObj); + // A buffer is resizable if maxByteLength was specified in constructor + return self.maxByteLength != null; + } + + // ES2024 ArrayBuffer.prototype.maxByteLength getter + private static Object js_maxByteLength(Scriptable thisObj) { + NativeArrayBuffer self = getSelf(thisObj); + // For fixed-length buffers, maxByteLength = byteLength + // For resizable buffers, return the maxByteLength + if (self.maxByteLength != null) { + return self.maxByteLength; + } else { + return self.getLength(); + } + } } diff --git a/tests/src/test/java/org/mozilla/javascript/tests/es2024/ResizableArrayBufferTest.java b/tests/src/test/java/org/mozilla/javascript/tests/es2024/ResizableArrayBufferTest.java new file mode 100644 index 0000000000..9f946d00d6 --- /dev/null +++ b/tests/src/test/java/org/mozilla/javascript/tests/es2024/ResizableArrayBufferTest.java @@ -0,0 +1,261 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.javascript.tests.es2024; + +import org.junit.Test; +import org.mozilla.javascript.testutils.Utils; + +public class ResizableArrayBufferTest { + + // Basic resizable buffer creation + @Test + public void testResizableBufferCreation() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "buffer.byteLength === 8 && buffer.maxByteLength === 16 && buffer.resizable === true"; + Utils.assertWithAllModes(true, script); + } + + // Fixed-length buffer (no maxByteLength) + @Test + public void testFixedLengthBuffer() { + String script = + "var buffer = new ArrayBuffer(8);" + + "buffer.byteLength === 8 && buffer.maxByteLength === 8 && buffer.resizable === false"; + Utils.assertWithAllModes(true, script); + } + + // Resize - grow buffer + @Test + public void testResizeGrow() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "buffer.resize(12);" + + "buffer.byteLength === 12"; + Utils.assertWithAllModes(true, script); + } + + // Resize - shrink buffer + @Test + public void testResizeShrink() { + String script = + "var buffer = new ArrayBuffer(16, { maxByteLength: 32 });" + + "buffer.resize(8);" + + "buffer.byteLength === 8"; + Utils.assertWithAllModes(true, script); + } + + // Resize - preserve data when growing + @Test + public void testResizePreservesData() { + String script = + "var buffer = new ArrayBuffer(4, { maxByteLength: 16 });" + + "var view = new Uint8Array(buffer);" + + "view[0] = 1; view[1] = 2; view[2] = 3; view[3] = 4;" + + "buffer.resize(8);" + + "var newView = new Uint8Array(buffer);" + + "newView[0] === 1 && newView[1] === 2 && newView[2] === 3 && newView[3] === 4"; + Utils.assertWithAllModes(true, script); + } + + // Resize - new bytes are zero + @Test + public void testResizeNewBytesZero() { + String script = + "var buffer = new ArrayBuffer(4, { maxByteLength: 16 });" + + "buffer.resize(8);" + + "var view = new Uint8Array(buffer);" + + "view[4] === 0 && view[5] === 0 && view[6] === 0 && view[7] === 0"; + Utils.assertWithAllModes(true, script); + } + + // Resize - preserve data when shrinking + @Test + public void testResizeShrinkPreservesData() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "var view = new Uint8Array(buffer);" + + "view[0] = 1; view[1] = 2; view[2] = 3; view[3] = 4;" + + "buffer.resize(4);" + + "var newView = new Uint8Array(buffer);" + + "newView[0] === 1 && newView[1] === 2 && newView[2] === 3 && newView[3] === 4"; + Utils.assertWithAllModes(true, script); + } + + // Error: resize beyond maxByteLength + @Test + public void testResizeBeyondMax() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "try {" + + " buffer.resize(32);" + + " false;" + + "} catch(e) {" + + " e instanceof RangeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Error: resize fixed-length buffer + @Test + public void testResizeFixedLengthError() { + String script = + "var buffer = new ArrayBuffer(8);" + + "try {" + + " buffer.resize(16);" + + " false;" + + "} catch(e) {" + + " e instanceof TypeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Error: resize detached buffer + @Test + public void testResizeDetachedBuffer() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "buffer.transfer();" + + "try {" + + " buffer.resize(12);" + + " false;" + + "} catch(e) {" + + " e instanceof TypeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Error: length exceeds maxByteLength in constructor + @Test + public void testConstructorLengthExceedsMax() { + String script = + "try {" + + " new ArrayBuffer(32, { maxByteLength: 16 });" + + " false;" + + "} catch(e) {" + + " e instanceof RangeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Error: negative maxByteLength + @Test + public void testNegativeMaxByteLength() { + String script = + "try {" + + " new ArrayBuffer(8, { maxByteLength: -1 });" + + " false;" + + "} catch(e) {" + + " e instanceof RangeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Resize to same size (no-op) + @Test + public void testResizeSameSize() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "buffer.resize(8);" + + "buffer.byteLength === 8"; + Utils.assertWithAllModes(true, script); + } + + // Resize to zero + @Test + public void testResizeToZero() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "buffer.resize(0);" + + "buffer.byteLength === 0"; + Utils.assertWithAllModes(true, script); + } + + // Resize from zero + @Test + public void testResizeFromZero() { + String script = + "var buffer = new ArrayBuffer(0, { maxByteLength: 16 });" + + "buffer.resize(8);" + + "buffer.byteLength === 8"; + Utils.assertWithAllModes(true, script); + } + + // maxByteLength equals byteLength + @Test + public void testMaxByteLengthEqualsLength() { + String script = + "var buffer = new ArrayBuffer(16, { maxByteLength: 16 });" + + "buffer.byteLength === 16 && buffer.maxByteLength === 16 && buffer.resizable === true"; + Utils.assertWithAllModes(true, script); + } + + // Resize multiple times + @Test + public void testResizeMultipleTimes() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 32 });" + + "buffer.resize(16);" + + "buffer.resize(24);" + + "buffer.resize(12);" + + "buffer.byteLength === 12"; + Utils.assertWithAllModes(true, script); + } + + // NaN maxByteLength converts to 0 + @Test + public void testNaNMaxByteLength() { + String script = + "var buffer = new ArrayBuffer(0, { maxByteLength: NaN });" + + "buffer.maxByteLength === 0 && buffer.resizable === true"; + Utils.assertWithAllModes(true, script); + } + + // Undefined maxByteLength option + @Test + public void testUndefinedMaxByteLength() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: undefined });" + + "buffer.resizable === false && buffer.maxByteLength === 8"; + Utils.assertWithAllModes(true, script); + } + + // Empty options object + @Test + public void testEmptyOptions() { + String script = + "var buffer = new ArrayBuffer(8, {});" + + "buffer.resizable === false && buffer.maxByteLength === 8"; + Utils.assertWithAllModes(true, script); + } + + // Error: resize negative size + @Test + public void testResizeNegative() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "try {" + + " buffer.resize(-1);" + + " false;" + + "} catch(e) {" + + " e instanceof RangeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } + + // Error: resize to Infinity + @Test + public void testResizeInfinity() { + String script = + "var buffer = new ArrayBuffer(8, { maxByteLength: 16 });" + + "try {" + + " buffer.resize(Infinity);" + + " false;" + + "} catch(e) {" + + " e instanceof RangeError;" + + "}"; + Utils.assertWithAllModes(true, script); + } +} From d8bdba536e297c7c7eefe88e850a5fef49487049 Mon Sep 17 00:00:00 2001 From: anivar Date: Sat, 29 Nov 2025 21:09:01 +0000 Subject: [PATCH 2/7] Enable resizable-arraybuffer in test262 suite Removed resizable-arraybuffer from unsupported features list. Updated test262.properties removing {unsupported: [resizable-arraybuffer]} markers from all passing tests. --- .../javascript/tests/Test262SuiteTest.java | 1 - tests/testsrc/test262.properties | 705 +++++++++--------- 2 files changed, 332 insertions(+), 374 deletions(-) diff --git a/tests/src/test/java/org/mozilla/javascript/tests/Test262SuiteTest.java b/tests/src/test/java/org/mozilla/javascript/tests/Test262SuiteTest.java index ae9e60a006..6b4ae4fff3 100644 --- a/tests/src/test/java/org/mozilla/javascript/tests/Test262SuiteTest.java +++ b/tests/src/test/java/org/mozilla/javascript/tests/Test262SuiteTest.java @@ -102,7 +102,6 @@ public class Test262SuiteTest { "object-rest", "regexp-dotall", "regexp-unicode-property-escapes", - "resizable-arraybuffer", "SharedArrayBuffer", "tail-call-optimization", "Temporal", diff --git a/tests/testsrc/test262.properties b/tests/testsrc/test262.properties index c367b35bbd..766cd81024 100644 --- a/tests/testsrc/test262.properties +++ b/tests/testsrc/test262.properties @@ -455,89 +455,89 @@ built-ins/AggregateError 2/25 (8.0%) built-ins/Array 257/3077 (8.35%) fromAsync 95/95 (100.0%) length/define-own-prop-length-coercion-order-set.js - prototype/at/coerced-index-resize.js {unsupported: [resizable-arraybuffer]} - prototype/at/typed-array-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/at/coerced-index-resize.js + prototype/at/typed-array-resizable-buffer.js prototype/concat/Array.prototype.concat_non-array.js prototype/concat/create-proto-from-ctor-realm-array.js prototype/concat/create-proxy.js prototype/copyWithin/coerced-values-start-change-start.js prototype/copyWithin/coerced-values-start-change-target.js - prototype/copyWithin/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/copyWithin/resizable-buffer.js prototype/copyWithin/return-abrupt-from-delete-target.js non-strict Not throwing properly on unwritable - prototype/entries/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/entries/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/entries/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/entries/resizable-buffer.js + prototype/entries/resizable-buffer-grow-mid-iteration.js + prototype/entries/resizable-buffer-shrink-mid-iteration.js prototype/every/15.4.4.16-5-1-s.js non-strict - prototype/every/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/fill/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/fill/typed-array-resize.js {unsupported: [resizable-arraybuffer]} + prototype/every/callbackfn-resize-arraybuffer.js + prototype/every/resizable-buffer.js + prototype/every/resizable-buffer-grow-mid-iteration.js + prototype/every/resizable-buffer-shrink-mid-iteration.js + prototype/fill/resizable-buffer.js + prototype/fill/typed-array-resize.js prototype/filter/15.4.4.20-5-1-s.js non-strict - prototype/filter/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/filter/callbackfn-resize-arraybuffer.js prototype/filter/create-proto-from-ctor-realm-array.js prototype/filter/create-proxy.js - prototype/filter/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/filter/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/filter/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/filter/resizable-buffer.js + prototype/filter/resizable-buffer-grow-mid-iteration.js + prototype/filter/resizable-buffer-shrink-mid-iteration.js + prototype/findIndex/callbackfn-resize-arraybuffer.js prototype/findIndex/predicate-call-this-strict.js strict - prototype/findIndex/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/findIndex/resizable-buffer.js + prototype/findIndex/resizable-buffer-grow-mid-iteration.js + prototype/findIndex/resizable-buffer-shrink-mid-iteration.js + prototype/findLastIndex/callbackfn-resize-arraybuffer.js prototype/findLastIndex/predicate-call-this-strict.js strict - prototype/findLastIndex/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/findLastIndex/resizable-buffer.js + prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js + prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js + prototype/findLast/callbackfn-resize-arraybuffer.js prototype/findLast/predicate-call-this-strict.js strict - prototype/findLast/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/find/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/findLast/resizable-buffer.js + prototype/findLast/resizable-buffer-grow-mid-iteration.js + prototype/findLast/resizable-buffer-shrink-mid-iteration.js + prototype/find/callbackfn-resize-arraybuffer.js prototype/find/predicate-call-this-strict.js strict - prototype/find/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/find/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/find/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/find/resizable-buffer.js + prototype/find/resizable-buffer-grow-mid-iteration.js + prototype/find/resizable-buffer-shrink-mid-iteration.js prototype/flatMap/proxy-access-count.js prototype/flatMap/this-value-ctor-object-species-custom-ctor.js prototype/flatMap/this-value-ctor-object-species-custom-ctor-poisoned-throws.js prototype/flatMap/thisArg-argument.js strict prototype/flat/proxy-access-count.js prototype/forEach/15.4.4.18-5-1-s.js non-strict - prototype/forEach/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/includes/coerced-searchelement-fromindex-resize.js {unsupported: [resizable-arraybuffer]} - prototype/includes/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/includes/resizable-buffer-special-float-values.js {unsupported: [resizable-arraybuffer]} + prototype/forEach/callbackfn-resize-arraybuffer.js + prototype/forEach/resizable-buffer.js + prototype/forEach/resizable-buffer-grow-mid-iteration.js + prototype/forEach/resizable-buffer-shrink-mid-iteration.js + prototype/includes/coerced-searchelement-fromindex-resize.js + prototype/includes/resizable-buffer.js + prototype/includes/resizable-buffer-special-float-values.js prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js - prototype/indexOf/coerced-searchelement-fromindex-grow.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/coerced-searchelement-fromindex-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/indexOf/coerced-searchelement-fromindex-grow.js + prototype/indexOf/coerced-searchelement-fromindex-shrink.js prototype/indexOf/length-zero-returns-minus-one.js - prototype/indexOf/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/resizable-buffer-special-float-values.js {unsupported: [resizable-arraybuffer]} - prototype/join/coerced-separator-grow.js {unsupported: [resizable-arraybuffer]} - prototype/join/coerced-separator-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/join/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/indexOf/resizable-buffer.js + prototype/indexOf/resizable-buffer-special-float-values.js + prototype/join/coerced-separator-grow.js + prototype/join/coerced-separator-shrink.js + prototype/join/resizable-buffer.js + prototype/keys/resizable-buffer.js + prototype/keys/resizable-buffer-grow-mid-iteration.js + prototype/keys/resizable-buffer-shrink-mid-iteration.js prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js - prototype/lastIndexOf/coerced-position-grow.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/coerced-position-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/lastIndexOf/coerced-position-grow.js + prototype/lastIndexOf/coerced-position-shrink.js prototype/lastIndexOf/length-zero-returns-minus-one.js - prototype/lastIndexOf/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/lastIndexOf/resizable-buffer.js prototype/map/15.4.4.19-5-1-s.js non-strict - prototype/map/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/map/callbackfn-resize-arraybuffer.js prototype/map/create-proto-from-ctor-realm-array.js prototype/map/create-proxy.js - prototype/map/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/map/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/map/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/map/resizable-buffer.js + prototype/map/resizable-buffer-grow-mid-iteration.js + prototype/map/resizable-buffer-shrink-mid-iteration.js prototype/pop/set-length-array-is-frozen.js prototype/pop/set-length-array-length-is-non-writable.js prototype/pop/set-length-zero-array-is-frozen.js non-strict @@ -552,37 +552,37 @@ built-ins/Array 257/3077 (8.35%) prototype/push/throws-if-integer-limit-exceeded.js incorrect length handling prototype/push/throws-with-string-receiver.js non-strict prototype/reduceRight/15.4.4.22-9-c-ii-4-s.js non-strict - prototype/reduceRight/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/reduceRight/callbackfn-resize-arraybuffer.js + prototype/reduceRight/resizable-buffer.js + prototype/reduceRight/resizable-buffer-grow-mid-iteration.js + prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js prototype/reduce/15.4.4.21-9-c-ii-4-s.js non-strict - prototype/reduce/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/reduce/callbackfn-resize-arraybuffer.js + prototype/reduce/resizable-buffer.js + prototype/reduce/resizable-buffer-grow-mid-iteration.js + prototype/reduce/resizable-buffer-shrink-mid-iteration.js prototype/reverse/length-exceeding-integer-limit-with-proxy.js - prototype/reverse/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/reverse/resizable-buffer.js prototype/shift/set-length-array-is-frozen.js prototype/shift/set-length-array-length-is-non-writable.js prototype/shift/set-length-zero-array-is-frozen.js non-strict prototype/shift/set-length-zero-array-length-is-non-writable.js non-strict prototype/shift/throws-when-this-value-length-is-writable-false.js non-strict - prototype/slice/coerced-start-end-grow.js {unsupported: [resizable-arraybuffer]} - prototype/slice/coerced-start-end-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/slice/coerced-start-end-grow.js + prototype/slice/coerced-start-end-shrink.js prototype/slice/create-proto-from-ctor-realm-array.js prototype/slice/create-proxy.js prototype/slice/create-species.js - prototype/slice/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/slice/resizable-buffer.js prototype/some/15.4.4.17-5-1-s.js non-strict - prototype/some/callbackfn-resize-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-grow.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/sort/resizable-buffer-default-comparator.js {unsupported: [resizable-arraybuffer]} + prototype/some/callbackfn-resize-arraybuffer.js + prototype/some/resizable-buffer.js + prototype/some/resizable-buffer-grow-mid-iteration.js + prototype/some/resizable-buffer-shrink-mid-iteration.js + prototype/sort/comparefn-grow.js + prototype/sort/comparefn-resizable-buffer.js + prototype/sort/comparefn-shrink.js + prototype/sort/resizable-buffer-default-comparator.js prototype/sort/S15.4.4.11_A8.js non-strict prototype/splice/clamps-length-to-integer-limit.js prototype/splice/create-proto-from-ctor-realm-array.js @@ -599,9 +599,9 @@ built-ins/Array 257/3077 (8.35%) prototype/toLocaleString/invoke-element-tolocalestring.js prototype/toLocaleString/primitive_this_value.js strict prototype/toLocaleString/primitive_this_value_getter.js strict - prototype/toLocaleString/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/user-provided-tolocalestring-grow.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/user-provided-tolocalestring-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/toLocaleString/resizable-buffer.js + prototype/toLocaleString/user-provided-tolocalestring-grow.js + prototype/toLocaleString/user-provided-tolocalestring-shrink.js prototype/toString/call-with-boolean.js prototype/toString/non-callable-join-string-tag.js prototype/unshift/set-length-array-is-frozen.js @@ -609,57 +609,37 @@ built-ins/Array 257/3077 (8.35%) prototype/unshift/set-length-zero-array-is-frozen.js non-strict prototype/unshift/set-length-zero-array-length-is-non-writable.js prototype/unshift/throws-with-string-receiver.js non-strict - prototype/values/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/values/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/values/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} + prototype/values/resizable-buffer.js + prototype/values/resizable-buffer-grow-mid-iteration.js + prototype/values/resizable-buffer-shrink-mid-iteration.js prototype/methods-called-as-functions.js proto-from-ctor-realm-one.js proto-from-ctor-realm-two.js proto-from-ctor-realm-zero.js -built-ins/ArrayBuffer 87/196 (44.39%) +built-ins/ArrayBuffer 27/196 (13.78%) isView/arg-is-dataview-subclass-instance.js {unsupported: [class]} isView/arg-is-typedarray-subclass-instance.js {unsupported: [class]} prototype/byteLength/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} - prototype/detached/detached-buffer-resizable.js {unsupported: [resizable-arraybuffer]} prototype/detached/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} prototype/detached/this-is-sharedarraybuffer-resizable.js {unsupported: [SharedArrayBuffer]} - prototype/maxByteLength 11/11 (100.0%) - prototype/resizable 10/10 (100.0%) - prototype/resize 22/22 (100.0%) + prototype/maxByteLength/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} + prototype/resizable/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} + prototype/resize/coerced-new-length-detach.js + prototype/resize/this-is-immutable-arraybuffer-object.js + prototype/resize/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} prototype/slice/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} - prototype/transferToFixedLength/from-fixed-to-larger.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-fixed-to-same.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-fixed-to-smaller.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-fixed-to-zero.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-resizable-to-larger.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-resizable-to-same.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-resizable-to-smaller.js {unsupported: [resizable-arraybuffer]} - prototype/transferToFixedLength/from-resizable-to-zero.js {unsupported: [resizable-arraybuffer]} prototype/transferToFixedLength/this-is-immutable-arraybuffer.js prototype/transferToFixedLength/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} - prototype/transfer/from-fixed-to-larger.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-fixed-to-same.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-fixed-to-smaller.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-fixed-to-zero.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-resizable-to-larger.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-resizable-to-same.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-resizable-to-smaller.js {unsupported: [resizable-arraybuffer]} - prototype/transfer/from-resizable-to-zero.js {unsupported: [resizable-arraybuffer]} + prototype/transfer/from-resizable-to-larger.js + prototype/transfer/from-resizable-to-same.js + prototype/transfer/from-resizable-to-smaller.js + prototype/transfer/from-resizable-to-zero.js prototype/transfer/this-is-immutable-arraybuffer.js prototype/transfer/this-is-sharedarraybuffer.js {unsupported: [SharedArrayBuffer]} Symbol.species 4/4 (100.0%) data-allocation-after-object-creation.js - options-maxbytelength-allocation-limit.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-compared-before-object-creation.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-data-allocation-after-object-creation.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-diminuitive.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-excessive.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-negative.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-object.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-poisoned.js {unsupported: [resizable-arraybuffer]} - options-maxbytelength-undefined.js {unsupported: [resizable-arraybuffer]} - options-non-object.js {unsupported: [resizable-arraybuffer]} + options-maxbytelength-data-allocation-after-object-creation.js proto-from-ctor-realm.js prototype-from-newtarget.js @@ -688,15 +668,13 @@ built-ins/BigInt 4/75 (5.33%) built-ins/Boolean 1/51 (1.96%) proto-from-ctor-realm.js -built-ins/DataView 161/561 (28.7%) +built-ins/DataView 142/561 (25.31%) prototype/buffer/return-buffer-sab.js {unsupported: [SharedArrayBuffer]} prototype/buffer/this-has-no-dataview-internal-sab.js {unsupported: [SharedArrayBuffer]} - prototype/byteLength/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} + prototype/byteLength/resizable-array-buffer-auto.js prototype/byteLength/return-bytelength-sab.js {unsupported: [SharedArrayBuffer]} prototype/byteLength/this-has-no-dataview-internal-sab.js {unsupported: [SharedArrayBuffer]} - prototype/byteOffset/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} + prototype/byteOffset/resizable-array-buffer-auto.js prototype/byteOffset/return-byteoffset-sab.js {unsupported: [SharedArrayBuffer]} prototype/byteOffset/this-has-no-dataview-internal-sab.js {unsupported: [SharedArrayBuffer]} prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js @@ -705,7 +683,7 @@ built-ins/DataView 161/561 (28.7%) prototype/getBigInt64/name.js prototype/getBigInt64/negative-byteoffset-throws.js prototype/getBigInt64/not-a-constructor.js - prototype/getBigInt64/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/getBigInt64/resizable-buffer.js prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js prototype/getBigInt64/return-value-clean-arraybuffer.js prototype/getBigInt64/return-values.js @@ -721,7 +699,7 @@ built-ins/DataView 161/561 (28.7%) prototype/getBigUint64/name.js prototype/getBigUint64/negative-byteoffset-throws.js prototype/getBigUint64/not-a-constructor.js - prototype/getBigUint64/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/getBigUint64/resizable-buffer.js prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js prototype/getBigUint64/return-value-clean-arraybuffer.js prototype/getBigUint64/return-values.js @@ -738,7 +716,7 @@ built-ins/DataView 161/561 (28.7%) prototype/getFloat16/name.js prototype/getFloat16/negative-byteoffset-throws.js prototype/getFloat16/not-a-constructor.js - prototype/getFloat16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/getFloat16/resizable-buffer.js prototype/getFloat16/return-abrupt-from-tonumber-byteoffset.js prototype/getFloat16/return-infinity.js prototype/getFloat16/return-nan.js @@ -747,12 +725,8 @@ built-ins/DataView 161/561 (28.7%) prototype/getFloat16/return-values-custom-offset.js prototype/getFloat16/to-boolean-littleendian.js prototype/getFloat16/toindex-byteoffset.js - prototype/getFloat32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/getFloat64/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/getInt16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/getInt32/index-is-out-of-range-sab.js {unsupported: [SharedArrayBuffer]} prototype/getInt32/negative-byteoffset-throws-sab.js {unsupported: [SharedArrayBuffer]} - prototype/getInt32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/getInt32/return-abrupt-from-tonumber-byteoffset-sab.js {unsupported: [SharedArrayBuffer]} prototype/getInt32/return-abrupt-from-tonumber-byteoffset-symbol-sab.js {unsupported: [SharedArrayBuffer]} prototype/getInt32/return-value-clean-arraybuffer-sab.js {unsupported: [SharedArrayBuffer]} @@ -761,10 +735,6 @@ built-ins/DataView 161/561 (28.7%) prototype/getInt32/this-has-no-dataview-internal-sab.js {unsupported: [SharedArrayBuffer]} prototype/getInt32/to-boolean-littleendian-sab.js {unsupported: [SharedArrayBuffer]} prototype/getInt32/toindex-byteoffset-sab.js {unsupported: [SharedArrayBuffer]} - prototype/getInt8/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/getUint16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/getUint32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/getUint8/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setBigInt64/detached-buffer-after-bigint-value.js prototype/setBigInt64/detached-buffer-after-toindex-byteoffset.js prototype/setBigInt64/immutable-buffer.js @@ -775,7 +745,7 @@ built-ins/DataView 161/561 (28.7%) prototype/setBigInt64/negative-byteoffset-throws.js prototype/setBigInt64/not-a-constructor.js prototype/setBigInt64/range-check-after-value-conversion.js - prototype/setBigInt64/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/setBigInt64/resizable-buffer.js prototype/setBigInt64/return-abrupt-from-tobigint-value.js prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js prototype/setBigInt64/set-values-little-endian-order.js @@ -794,7 +764,7 @@ built-ins/DataView 161/561 (28.7%) prototype/setFloat16/no-value-arg.js prototype/setFloat16/not-a-constructor.js prototype/setFloat16/range-check-after-value-conversion.js - prototype/setFloat16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/setFloat16/resizable-buffer.js prototype/setFloat16/return-abrupt-from-tonumber-byteoffset.js prototype/setFloat16/return-abrupt-from-tonumber-value.js prototype/setFloat16/set-values-little-endian-order.js @@ -802,29 +772,20 @@ built-ins/DataView 161/561 (28.7%) prototype/setFloat16/to-boolean-littleendian.js prototype/setFloat16/toindex-byteoffset.js prototype/setFloat32/immutable-buffer.js - prototype/setFloat32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setFloat64/immutable-buffer.js - prototype/setFloat64/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setInt16/immutable-buffer.js - prototype/setInt16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setInt32/immutable-buffer.js - prototype/setInt32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setInt8/immutable-buffer.js - prototype/setInt8/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setUint16/immutable-buffer.js - prototype/setUint16/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setUint32/immutable-buffer.js - prototype/setUint32/resizable-buffer.js {unsupported: [resizable-arraybuffer]} prototype/setUint8/immutable-buffer.js - prototype/setUint8/resizable-buffer.js {unsupported: [resizable-arraybuffer]} buffer-does-not-have-arraybuffer-data-throws-sab.js {unsupported: [SharedArrayBuffer]} buffer-reference-sab.js {unsupported: [SharedArrayBuffer]} byteoffset-is-negative-throws-sab.js {unsupported: [SharedArrayBuffer]} custom-proto-access-detaches-buffer.js - custom-proto-access-resizes-buffer-invalid-by-length.js {unsupported: [resizable-arraybuffer]} - custom-proto-access-resizes-buffer-invalid-by-offset.js {unsupported: [resizable-arraybuffer]} - custom-proto-access-resizes-buffer-valid-by-length.js {unsupported: [resizable-arraybuffer]} - custom-proto-access-resizes-buffer-valid-by-offset.js {unsupported: [resizable-arraybuffer]} + custom-proto-access-resizes-buffer-invalid-by-length.js + custom-proto-access-resizes-buffer-invalid-by-offset.js + custom-proto-access-resizes-buffer-valid-by-offset.js custom-proto-access-throws.js custom-proto-access-throws-sab.js {unsupported: [SharedArrayBuffer]} custom-proto-if-not-object-fallbacks-to-default-prototype-sab.js {unsupported: [SharedArrayBuffer]} @@ -949,7 +910,7 @@ built-ins/Function 126/509 (24.75%) prototype/apply/15.3.4.3-2-s.js strict prototype/apply/15.3.4.3-3-s.js strict prototype/apply/argarray-not-object-realm.js - prototype/apply/resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/apply/resizable-buffer.js prototype/apply/this-not-callable-realm.js prototype/arguments/prop-desc.js prototype/bind/BoundFunction_restricted-properties.js @@ -1534,7 +1495,7 @@ built-ins/Object 118/3410 (3.46%) defineProperties/15.2.3.7-6-a-185.js defineProperties/15.2.3.7-6-a-282.js defineProperties/proxy-no-ownkeys-returned-keys-order.js - defineProperties/typedarray-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + defineProperties/typedarray-backed-by-resizable-buffer.js defineProperty/15.2.3.6-4-116.js non-strict defineProperty/15.2.3.6-4-117.js non-strict defineProperty/15.2.3.6-4-168.js @@ -1552,13 +1513,13 @@ built-ins/Object 118/3410 (3.46%) defineProperty/15.2.3.6-4-293-3.js non-strict defineProperty/15.2.3.6-4-293-4.js strict defineProperty/15.2.3.6-4-336.js - defineProperty/coerced-P-grow.js {unsupported: [resizable-arraybuffer]} - defineProperty/coerced-P-shrink.js {unsupported: [resizable-arraybuffer]} - defineProperty/typedarray-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + defineProperty/coerced-P-grow.js + defineProperty/coerced-P-shrink.js + defineProperty/typedarray-backed-by-resizable-buffer.js entries/observable-operations.js freeze/proxy-no-ownkeys-returned-keys-order.js freeze/proxy-with-defineProperty-handler.js - freeze/typedarray-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + freeze/typedarray-backed-by-resizable-buffer.js getOwnPropertyDescriptors/order-after-define-property.js getOwnPropertyDescriptors/proxy-no-ownkeys-returned-keys-order.js getOwnPropertyDescriptors/proxy-undefined-descriptor.js @@ -2386,262 +2347,261 @@ built-ins/ThrowTypeError 2/14 (14.29%) unique-per-realm-function-proto.js unique-per-realm-non-simple.js non-strict -built-ins/TypedArray 256/1434 (17.85%) - from/from-array-mapper-makes-result-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - from/from-typedarray-mapper-makes-result-out-of-bounds.js {unsupported: [resizable-arraybuffer]} +built-ins/TypedArray 255/1434 (17.78%) + from/from-array-mapper-makes-result-out-of-bounds.js + from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js + from/from-typedarray-mapper-makes-result-out-of-bounds.js from/iterated-array-changed-by-tonumber.js - of/resized-with-out-of-bounds-and-in-bounds-indices.js {unsupported: [resizable-arraybuffer]} - prototype/at/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/at/coerced-index-resize.js {unsupported: [resizable-arraybuffer]} - prototype/at/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/at/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/BigInt/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/BigInt/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resizable-buffer-assorted.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resized-out-of-bounds-1.js {unsupported: [resizable-arraybuffer]} - prototype/byteLength/resized-out-of-bounds-2.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/BigInt/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/BigInt/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/byteOffset/resized-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/copyWithin/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/copyWithin/coerced-target-start-end-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/copyWithin/coerced-target-start-grow.js {unsupported: [resizable-arraybuffer]} - prototype/copyWithin/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/entries/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/entries/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/entries/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/entries/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/entries/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/every/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/every/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/every/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/every/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/fill/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/fill/absent-indices-computed-from-initial-length.js {unsupported: [resizable-arraybuffer]} - prototype/fill/coerced-value-start-end-resize.js {unsupported: [resizable-arraybuffer]} - prototype/fill/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/fill/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/filter/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/filter/BigInt/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + of/resized-with-out-of-bounds-and-in-bounds-indices.js + prototype/at/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/at/coerced-index-resize.js + prototype/at/resizable-buffer.js + prototype/at/return-abrupt-from-this-out-of-bounds.js + prototype/byteLength/BigInt/resizable-array-buffer-auto.js + prototype/byteLength/BigInt/resizable-array-buffer-fixed.js + prototype/byteLength/resizable-array-buffer-auto.js + prototype/byteLength/resizable-array-buffer-fixed.js + prototype/byteLength/resizable-buffer-assorted.js + prototype/byteLength/resized-out-of-bounds-1.js + prototype/byteLength/resized-out-of-bounds-2.js + prototype/byteOffset/BigInt/resizable-array-buffer-auto.js + prototype/byteOffset/BigInt/resizable-array-buffer-fixed.js + prototype/byteOffset/resizable-array-buffer-auto.js + prototype/byteOffset/resizable-array-buffer-fixed.js + prototype/byteOffset/resized-out-of-bounds.js + prototype/copyWithin/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/copyWithin/coerced-target-start-end-shrink.js + prototype/copyWithin/coerced-target-start-grow.js + prototype/copyWithin/resizable-buffer.js + prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js + prototype/entries/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/entries/resizable-buffer.js + prototype/entries/resizable-buffer-grow-mid-iteration.js + prototype/entries/resizable-buffer-shrink-mid-iteration.js + prototype/entries/return-abrupt-from-this-out-of-bounds.js + prototype/every/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/every/callbackfn-resize.js + prototype/every/resizable-buffer.js + prototype/every/resizable-buffer-grow-mid-iteration.js + prototype/every/resizable-buffer-shrink-mid-iteration.js + prototype/every/return-abrupt-from-this-out-of-bounds.js + prototype/fill/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/fill/absent-indices-computed-from-initial-length.js + prototype/fill/coerced-value-start-end-resize.js + prototype/fill/resizable-buffer.js + prototype/fill/return-abrupt-from-this-out-of-bounds.js + prototype/filter/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/filter/BigInt/speciesctor-destination-resizable.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws.js - prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/filter/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/filter/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/filter/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/filter/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/filter/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/filter/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js + prototype/filter/callbackfn-resize.js + prototype/filter/resizable-buffer.js + prototype/filter/resizable-buffer-grow-mid-iteration.js + prototype/filter/resizable-buffer-shrink-mid-iteration.js + prototype/filter/return-abrupt-from-this-out-of-bounds.js + prototype/filter/speciesctor-destination-resizable.js prototype/filter/speciesctor-get-species-custom-ctor-invocation.js prototype/filter/speciesctor-get-species-custom-ctor-length-throws.js - prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/find/BigInt/predicate-call-this-strict.js strict - prototype/find/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/find/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findIndex/BigInt/predicate-call-this-strict.js strict - prototype/findIndex/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} + prototype/findIndex/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/findIndex/callbackfn-resize.js prototype/findIndex/predicate-call-this-strict.js strict - prototype/findIndex/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findIndex/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/findIndex/resizable-buffer.js + prototype/findIndex/resizable-buffer-grow-mid-iteration.js + prototype/findIndex/resizable-buffer-shrink-mid-iteration.js + prototype/findIndex/return-abrupt-from-this-out-of-bounds.js prototype/findLast/BigInt/predicate-call-this-strict.js strict - prototype/findLast/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/findLast/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findLastIndex/BigInt/predicate-call-this-strict.js strict - prototype/findLastIndex/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} + prototype/findLastIndex/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/findLastIndex/callbackfn-resize.js prototype/findLastIndex/predicate-call-this-strict.js strict - prototype/findLastIndex/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} + prototype/findLastIndex/resizable-buffer.js + prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js + prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js + prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js + prototype/findLast/callbackfn-resize.js prototype/findLast/predicate-call-this-strict.js strict - prototype/findLast/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/findLast/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/find/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} + prototype/findLast/resizable-buffer.js + prototype/findLast/resizable-buffer-grow-mid-iteration.js + prototype/findLast/resizable-buffer-shrink-mid-iteration.js + prototype/findLast/return-abrupt-from-this-out-of-bounds.js + prototype/find/callbackfn-resize.js prototype/find/predicate-call-this-strict.js strict - prototype/find/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/find/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/find/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/find/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/forEach/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/includes/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/includes/coerced-searchelement-fromindex-resize.js {unsupported: [resizable-arraybuffer]} - prototype/includes/index-compared-against-initial-length.js {unsupported: [resizable-arraybuffer]} - prototype/includes/index-compared-against-initial-length-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/includes/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/includes/resizable-buffer-special-float-values.js {unsupported: [resizable-arraybuffer]} - prototype/includes/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/includes/search-undefined-after-shrinking-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/includes/search-undefined-after-shrinking-buffer-index-is-oob.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/coerced-searchelement-fromindex-grow.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/coerced-searchelement-fromindex-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/resizable-buffer-special-float-values.js {unsupported: [resizable-arraybuffer]} - prototype/indexOf/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/join/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/join/coerced-separator-grow.js {unsupported: [resizable-arraybuffer]} - prototype/join/coerced-separator-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/join/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/join/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/join/separator-tostring-once-after-resized.js {unsupported: [resizable-arraybuffer]} - prototype/keys/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/keys/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/keys/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/coerced-position-grow.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/coerced-position-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/negative-index-and-resize-to-smaller.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/resizable-buffer-special-float-values.js {unsupported: [resizable-arraybuffer]} - prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/length/BigInt/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/length/BigInt/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/length/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - prototype/length/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} - prototype/length/resizable-buffer-assorted.js {unsupported: [resizable-arraybuffer]} - prototype/length/resized-out-of-bounds-1.js {unsupported: [resizable-arraybuffer]} - prototype/length/resized-out-of-bounds-2.js {unsupported: [resizable-arraybuffer]} - prototype/map/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/map/BigInt/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + prototype/find/resizable-buffer.js + prototype/find/resizable-buffer-grow-mid-iteration.js + prototype/find/resizable-buffer-shrink-mid-iteration.js + prototype/find/return-abrupt-from-this-out-of-bounds.js + prototype/forEach/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/forEach/callbackfn-resize.js + prototype/forEach/resizable-buffer.js + prototype/forEach/resizable-buffer-grow-mid-iteration.js + prototype/forEach/resizable-buffer-shrink-mid-iteration.js + prototype/forEach/return-abrupt-from-this-out-of-bounds.js + prototype/includes/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/includes/coerced-searchelement-fromindex-resize.js + prototype/includes/index-compared-against-initial-length.js + prototype/includes/index-compared-against-initial-length-out-of-bounds.js + prototype/includes/resizable-buffer.js + prototype/includes/resizable-buffer-special-float-values.js + prototype/includes/return-abrupt-from-this-out-of-bounds.js + prototype/includes/search-undefined-after-shrinking-buffer.js + prototype/includes/search-undefined-after-shrinking-buffer-index-is-oob.js + prototype/indexOf/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/indexOf/coerced-searchelement-fromindex-grow.js + prototype/indexOf/coerced-searchelement-fromindex-shrink.js + prototype/indexOf/resizable-buffer.js + prototype/indexOf/resizable-buffer-special-float-values.js + prototype/indexOf/return-abrupt-from-this-out-of-bounds.js + prototype/join/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/join/coerced-separator-grow.js + prototype/join/coerced-separator-shrink.js + prototype/join/resizable-buffer.js + prototype/join/return-abrupt-from-this-out-of-bounds.js + prototype/join/separator-tostring-once-after-resized.js + prototype/keys/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/keys/resizable-buffer.js + prototype/keys/resizable-buffer-grow-mid-iteration.js + prototype/keys/resizable-buffer-shrink-mid-iteration.js + prototype/keys/return-abrupt-from-this-out-of-bounds.js + prototype/lastIndexOf/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/lastIndexOf/coerced-position-grow.js + prototype/lastIndexOf/coerced-position-shrink.js + prototype/lastIndexOf/negative-index-and-resize-to-smaller.js + prototype/lastIndexOf/resizable-buffer.js + prototype/lastIndexOf/resizable-buffer-special-float-values.js + prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js + prototype/length/BigInt/resizable-array-buffer-auto.js + prototype/length/BigInt/resizable-array-buffer-fixed.js + prototype/length/resizable-array-buffer-auto.js + prototype/length/resizable-array-buffer-fixed.js + prototype/length/resizable-buffer-assorted.js + prototype/length/resized-out-of-bounds-1.js + prototype/length/resized-out-of-bounds-2.js + prototype/map/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/map/BigInt/speciesctor-destination-resizable.js prototype/map/BigInt/speciesctor-get-ctor-abrupt.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-invocation.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-length-throws.js - prototype/map/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/map/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js - prototype/map/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/map/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/map/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/map/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/map/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/map/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + prototype/map/callbackfn-resize.js + prototype/map/resizable-buffer.js + prototype/map/resizable-buffer-grow-mid-iteration.js + prototype/map/resizable-buffer-shrink-mid-iteration.js + prototype/map/return-abrupt-from-this-out-of-bounds.js + prototype/map/speciesctor-destination-resizable.js prototype/map/speciesctor-get-ctor-abrupt.js prototype/map/speciesctor-get-species-custom-ctor-invocation.js prototype/map/speciesctor-get-species-custom-ctor-length-throws.js - prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} + prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js - prototype/map/speciesctor-resizable-buffer-grow.js {unsupported: [resizable-arraybuffer]} - prototype/map/speciesctor-resizable-buffer-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/reduce/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/reverse/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/reverse/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/reverse/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/map/speciesctor-resizable-buffer-grow.js + prototype/map/speciesctor-resizable-buffer-shrink.js + prototype/reduce/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/reduceRight/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/reduceRight/callbackfn-resize.js + prototype/reduceRight/resizable-buffer.js + prototype/reduceRight/resizable-buffer-grow-mid-iteration.js + prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js + prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js + prototype/reduce/callbackfn-resize.js + prototype/reduce/resizable-buffer.js + prototype/reduce/resizable-buffer-grow-mid-iteration.js + prototype/reduce/resizable-buffer-shrink-mid-iteration.js + prototype/reduce/return-abrupt-from-this-out-of-bounds.js + prototype/reverse/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/reverse/resizable-buffer.js + prototype/reverse/return-abrupt-from-this-out-of-bounds.js prototype/set/BigInt/array-arg-primitive-toobject.js prototype/set/BigInt/bigint-tobiguint64.js prototype/set/BigInt/number-tobigint.js prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} - prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-resized.js {unsupported: [resizable-arraybuffer]} + prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-resized.js prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} - prototype/set/BigInt/typedarray-arg-target-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/set/BigInt/typedarray-arg-target-out-of-bounds.js prototype/set/array-arg-primitive-toobject.js - prototype/set/array-arg-value-conversion-resizes-array-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/set/target-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/set/target-grow-source-length-getter.js {unsupported: [resizable-arraybuffer]} - prototype/set/target-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/set/target-shrink-source-length-getter.js {unsupported: [resizable-arraybuffer]} - prototype/set/this-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + prototype/set/array-arg-value-conversion-resizes-array-buffer.js + prototype/set/target-grow-mid-iteration.js + prototype/set/target-grow-source-length-getter.js + prototype/set/target-shrink-mid-iteration.js + prototype/set/target-shrink-source-length-getter.js + prototype/set/this-backed-by-resizable-buffer.js prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-set-values-same-buffer-other-type.js - prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js {unsupported: [resizable-arraybuffer]} + prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} - prototype/set/typedarray-arg-src-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/set/typedarray-arg-target-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/slice/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/slice/BigInt/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + prototype/set/typedarray-arg-src-backed-by-resizable-buffer.js + prototype/set/typedarray-arg-target-out-of-bounds.js + prototype/slice/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/slice/BigInt/speciesctor-destination-resizable.js prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws.js - prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/slice/coerced-start-end-grow.js {unsupported: [resizable-arraybuffer]} - prototype/slice/coerced-start-end-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/slice/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/slice/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/slice/speciesctor-destination-resizable.js {unsupported: [resizable-arraybuffer]} + prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js + prototype/slice/coerced-start-end-grow.js + prototype/slice/coerced-start-end-shrink.js + prototype/slice/resizable-buffer.js + prototype/slice/return-abrupt-from-this-out-of-bounds.js + prototype/slice/speciesctor-destination-resizable.js prototype/slice/speciesctor-get-species-custom-ctor-length-throws.js - prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js {unsupported: [resizable-arraybuffer]} - prototype/slice/speciesctor-resize.js {unsupported: [resizable-arraybuffer]} - prototype/some/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/some/callbackfn-resize.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/some/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/some/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/sort/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-grow.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/sort/comparefn-shrink.js {unsupported: [resizable-arraybuffer]} - prototype/sort/resizable-buffer-default-comparator.js {unsupported: [resizable-arraybuffer]} - prototype/sort/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js + prototype/slice/speciesctor-resize.js + prototype/some/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/some/callbackfn-resize.js + prototype/some/resizable-buffer.js + prototype/some/resizable-buffer-grow-mid-iteration.js + prototype/some/resizable-buffer-shrink-mid-iteration.js + prototype/some/return-abrupt-from-this-out-of-bounds.js + prototype/sort/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/sort/comparefn-grow.js + prototype/sort/comparefn-resizable-buffer.js + prototype/sort/comparefn-shrink.js + prototype/sort/resizable-buffer-default-comparator.js + prototype/sort/return-abrupt-from-this-out-of-bounds.js prototype/subarray/BigInt/infinity.js - prototype/subarray/coerced-begin-end-grow.js {unsupported: [resizable-arraybuffer]} - prototype/subarray/coerced-begin-end-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/subarray/coerced-begin-end-grow.js + prototype/subarray/coerced-begin-end-shrink.js prototype/subarray/infinity.js - prototype/subarray/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/subarray/result-byteOffset-from-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/subarray/resizable-buffer.js + prototype/subarray/result-byteOffset-from-out-of-bounds.js prototype/Symbol.toStringTag/BigInt/name.js prototype/Symbol.toStringTag/name.js - prototype/toLocaleString/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/user-provided-tolocalestring-grow.js {unsupported: [resizable-arraybuffer]} - prototype/toLocaleString/user-provided-tolocalestring-shrink.js {unsupported: [resizable-arraybuffer]} + prototype/toLocaleString/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/toLocaleString/resizable-buffer.js + prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js + prototype/toLocaleString/user-provided-tolocalestring-grow.js + prototype/toLocaleString/user-provided-tolocalestring-shrink.js prototype/toReversed/this-value-invalid.js prototype/toSorted/this-value-invalid.js - prototype/values/BigInt/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/values/make-in-bounds-after-exhausted.js {unsupported: [resizable-arraybuffer]} - prototype/values/make-out-of-bounds-after-exhausted.js {unsupported: [resizable-arraybuffer]} - prototype/values/resizable-buffer.js {unsupported: [resizable-arraybuffer]} - prototype/values/resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/values/resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - prototype/values/return-abrupt-from-this-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + prototype/values/BigInt/return-abrupt-from-this-out-of-bounds.js + prototype/values/make-in-bounds-after-exhausted.js + prototype/values/make-out-of-bounds-after-exhausted.js + prototype/values/resizable-buffer.js + prototype/values/resizable-buffer-grow-mid-iteration.js + prototype/values/resizable-buffer-shrink-mid-iteration.js + prototype/values/return-abrupt-from-this-out-of-bounds.js prototype/with/BigInt/early-type-coercion-bigint.js - prototype/with/index-validated-against-current-length.js {unsupported: [resizable-arraybuffer]} - prototype/with/negative-index-resize-to-in-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/with/negative-index-resize-to-out-of-bounds.js {unsupported: [resizable-arraybuffer]} - prototype/with/valid-typedarray-index-checked-after-coercions.js {unsupported: [resizable-arraybuffer]} - prototype/resizable-and-fixed-have-same-prototype.js {unsupported: [resizable-arraybuffer]} + prototype/with/index-validated-against-current-length.js + prototype/with/negative-index-resize-to-out-of-bounds.js + prototype/with/valid-typedarray-index-checked-after-coercions.js + prototype/resizable-and-fixed-have-same-prototype.js prototype/Symbol.iterator.js prototype/toString.js Symbol.species 4/4 (100.0%) - out-of-bounds-behaves-like-detached.js {unsupported: [resizable-arraybuffer]} - out-of-bounds-get-and-set.js {unsupported: [resizable-arraybuffer]} - out-of-bounds-has.js {unsupported: [resizable-arraybuffer]} + out-of-bounds-behaves-like-detached.js + out-of-bounds-get-and-set.js + out-of-bounds-has.js prototype.js - resizable-buffer-length-tracking-1.js {unsupported: [resizable-arraybuffer]} - resizable-buffer-length-tracking-2.js {unsupported: [resizable-arraybuffer]} + resizable-buffer-length-tracking-1.js + resizable-buffer-length-tracking-2.js -built-ins/TypedArrayConstructors 198/736 (26.9%) +built-ins/TypedArrayConstructors 197/736 (26.77%) ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-throws-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js {unsupported: [SharedArrayBuffer]} @@ -2713,7 +2673,6 @@ built-ins/TypedArrayConstructors 198/736 (26.9%) ctors/buffer-arg/defined-negative-length-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/defined-offset-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/excessive-length-throws-sab.js {unsupported: [SharedArrayBuffer]} - ctors/buffer-arg/excessive-offset-throws-resizable-ab.js {unsupported: [resizable-arraybuffer]} ctors/buffer-arg/excessive-offset-throws-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/invoked-with-undefined-newtarget-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/is-referenced-sab.js {unsupported: [SharedArrayBuffer]} @@ -2722,7 +2681,7 @@ built-ins/TypedArrayConstructors 198/736 (26.9%) ctors/buffer-arg/new-instance-extensibility-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/proto-from-ctor-realm.js ctors/buffer-arg/proto-from-ctor-realm-sab.js {unsupported: [SharedArrayBuffer]} - ctors/buffer-arg/resizable-out-of-bounds.js {unsupported: [resizable-arraybuffer]} + ctors/buffer-arg/resizable-out-of-bounds.js ctors/buffer-arg/returns-new-instance-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/toindex-bytelength-sab.js {unsupported: [SharedArrayBuffer]} ctors/buffer-arg/toindex-byteoffset-sab.js {unsupported: [SharedArrayBuffer]} @@ -2760,7 +2719,7 @@ built-ins/TypedArrayConstructors 198/736 (26.9%) ctors/object-arg/use-custom-proto-if-object.js ctors/typedarray-arg/custom-proto-access-throws.js ctors/typedarray-arg/proto-from-ctor-realm.js - ctors/typedarray-arg/src-typedarray-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + ctors/typedarray-arg/src-typedarray-resizable-buffer.js ctors/typedarray-arg/throw-type-error-before-custom-proto-access.js ctors/typedarray-arg/use-custom-proto-if-object.js ctors/no-species.js @@ -2810,16 +2769,16 @@ built-ins/TypedArrayConstructors 198/736 (26.9%) internals/HasProperty/key-is-lower-than-zero.js internals/HasProperty/key-is-minus-zero.js internals/HasProperty/key-is-not-integer.js - internals/HasProperty/resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - internals/HasProperty/resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} + internals/HasProperty/resizable-array-buffer-auto.js + internals/HasProperty/resizable-array-buffer-fixed.js internals/OwnPropertyKeys/BigInt/integer-indexes.js internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js internals/OwnPropertyKeys/integer-indexes.js internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js internals/OwnPropertyKeys/integer-indexes-and-string-keys.js - internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.js {unsupported: [resizable-arraybuffer]} - internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.js {unsupported: [resizable-arraybuffer]} + internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.js + internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.js internals/Set/BigInt/bigint-tobiguint64.js internals/Set/BigInt/key-is-canonical-invalid-index-prototype-chain-set.js internals/Set/BigInt/key-is-canonical-invalid-index-reflect-set.js @@ -2838,7 +2797,7 @@ built-ins/TypedArrayConstructors 198/736 (26.9%) internals/Set/key-is-symbol.js internals/Set/key-is-valid-index-prototype-chain-set.js internals/Set/key-is-valid-index-reflect-set.js - internals/Set/resized-out-of-bounds-to-in-bounds-index.js {unsupported: [resizable-arraybuffer]} + internals/Set/resized-out-of-bounds-to-in-bounds-index.js internals/Set/tonumber-value-throws.js built-ins/Uint8Array 58/66 (87.88%) @@ -3223,7 +3182,7 @@ language/destructuring 8/19 (42.11%) binding/initialization-requires-object-coercible-null.js binding/initialization-requires-object-coercible-undefined.js binding/keyed-destructuring-property-reference-target-evaluation-order-with-bindings.js non-strict - binding/typedarray-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} + binding/typedarray-backed-by-resizable-buffer.js language/directive-prologue 2/62 (3.23%) 14.1-4-s.js non-strict @@ -5914,7 +5873,7 @@ language/statements/for-in 40/115 (34.78%) let-block-with-newline.js non-strict let-identifier-with-newline.js non-strict order-enumerable-shadowed.js - resizable-buffer.js {unsupported: [resizable-arraybuffer]} + resizable-buffer.js scope-body-lex-boundary.js scope-body-lex-close.js scope-body-lex-open.js @@ -6329,11 +6288,11 @@ language/statements/for-of 410/751 (54.59%) scope-body-lex-open.js scope-head-lex-close.js scope-head-lex-open.js - typedarray-backed-by-resizable-buffer.js {unsupported: [resizable-arraybuffer]} - typedarray-backed-by-resizable-buffer-grow-before-end.js {unsupported: [resizable-arraybuffer]} - typedarray-backed-by-resizable-buffer-grow-mid-iteration.js {unsupported: [resizable-arraybuffer]} - typedarray-backed-by-resizable-buffer-shrink-mid-iteration.js {unsupported: [resizable-arraybuffer]} - typedarray-backed-by-resizable-buffer-shrink-to-zero-mid-iteration.js {unsupported: [resizable-arraybuffer]} + typedarray-backed-by-resizable-buffer.js + typedarray-backed-by-resizable-buffer-grow-before-end.js + typedarray-backed-by-resizable-buffer-grow-mid-iteration.js + typedarray-backed-by-resizable-buffer-shrink-mid-iteration.js + typedarray-backed-by-resizable-buffer-shrink-to-zero-mid-iteration.js language/statements/function 119/451 (26.39%) dstr/ary-ptrn-elem-ary-elision-init.js From 54e1a69fef62047cc3c036587357a97a3d68e5e9 Mon Sep 17 00:00:00 2001 From: anivar Date: Tue, 2 Dec 2025 18:35:12 -0500 Subject: [PATCH 3/7] Change maxByteLength from Integer to int primitive Address review feedback by using primitive int instead of boxed Integer for maxByteLength field. Uses -1 as sentinel value for fixed-length buffers instead of null. Benefits: - Better performance (no boxing/unboxing overhead) - Less memory usage (no object wrapper) - Follows Rhino coding conventions - More cache-friendly Changes: - NativeArrayBuffer.java: Changed field from Integer to int - Updated all null checks to use -1 sentinel value - All tests passing (Test262SuiteTest + ResizableArrayBuffer tests) --- .../javascript/typedarrays/NativeArrayBuffer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java index 77a700ace8..c8138fb969 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java @@ -29,8 +29,8 @@ public class NativeArrayBuffer extends ScriptableObject { private static final byte[] EMPTY_BUF = new byte[0]; byte[] buffer; - // ES2024: maxByteLength for resizable buffers (null = fixed-length) - private Integer maxByteLength; + // ES2024: maxByteLength for resizable buffers (-1 = fixed-length) + private int maxByteLength = -1; @Override public String getClassName() { @@ -152,7 +152,7 @@ private static NativeArrayBuffer js_constructor(Context cx, Scriptable scope, Ob double length = isArg(args, 0) ? ScriptRuntime.toNumber(args[0]) : 0; // ES2024: Check for options parameter with maxByteLength - Integer maxByteLength = null; + int maxByteLength = -1; if (isArg(args, 1) && args[1] instanceof Scriptable) { Scriptable options = (Scriptable) args[1]; Object maxByteLengthValue = ScriptableObject.getProperty(options, "maxByteLength"); @@ -408,7 +408,7 @@ private static Object js_resize( } // 4. If IsResizableArrayBuffer(O) is false, throw a TypeError exception - if (self.maxByteLength == null) { + if (self.maxByteLength < 0) { throw ScriptRuntime.typeError("ArrayBuffer is not resizable"); } @@ -477,7 +477,7 @@ private static Object js_resize( private static Object js_resizable(Scriptable thisObj) { NativeArrayBuffer self = getSelf(thisObj); // A buffer is resizable if maxByteLength was specified in constructor - return self.maxByteLength != null; + return self.maxByteLength >= 0; } // ES2024 ArrayBuffer.prototype.maxByteLength getter @@ -485,7 +485,7 @@ private static Object js_maxByteLength(Scriptable thisObj) { NativeArrayBuffer self = getSelf(thisObj); // For fixed-length buffers, maxByteLength = byteLength // For resizable buffers, return the maxByteLength - if (self.maxByteLength != null) { + if (self.maxByteLength >= 0) { return self.maxByteLength; } else { return self.getLength(); From babe782d1742dcc2a15b344b26a3af5bf1a114e6 Mon Sep 17 00:00:00 2001 From: anivar Date: Wed, 3 Dec 2025 03:46:31 -0500 Subject: [PATCH 4/7] Implement ES2025 auto-length tracking for TypedArray views Add support for TypedArray views that dynamically track the length of resizable ArrayBuffers. When a TypedArray is constructed without an explicit length parameter, it now operates in auto-length mode where the length is recomputed based on the current buffer size. Implementation: - Added boolean isAutoLength field to track auto-length mode - Removed final modifier from length field to allow dynamic updates - Created updateLength() method that recomputes length for auto-length views - Length is computed as: floor((bufferByteLength - offset) / elementSize) - Returns 0 when view is out of bounds (offset > buffer length) - updateLength() is called in isTypedArrayOutOfBounds() before bounds checks This approach minimizes code changes while maintaining compatibility with existing code that directly accesses the length field. Per ES2025 specification section 10.4.5.3 --- .../typedarrays/NativeTypedArrayView.java | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java index 9afc73fd8c..14d7900413 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java @@ -48,17 +48,59 @@ public abstract class NativeTypedArrayView extends NativeArrayBufferView implements List, RandomAccess, ExternalArrayData { private static final long serialVersionUID = -4963053773152251274L; - /** The length, in elements, of the array */ - protected final int length; + /** + * The length, in elements, of the array. + * For auto-length views, this is recomputed dynamically via updateLength(). + */ + protected int length; + + /** + * ES2025: Tracks whether this is an auto-length TypedArray view. + * Auto-length views dynamically compute their length based on the buffer size. + */ + private final boolean isAutoLength; protected NativeTypedArrayView() { super(); length = 0; + isAutoLength = false; } protected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen) { super(ab, off, byteLen); - length = len; + this.isAutoLength = (len < 0); + if (isAutoLength) { + // Compute initial length for auto-length views + updateLength(); + } else { + this.length = len; + } + } + + /** + * ES2025: Update the length for auto-length TypedArray views. + * For fixed-length views, this is a no-op. + * For auto-length views backed by resizable buffers, recomputes length based on current buffer size. + */ + protected void updateLength() { + if (!isAutoLength) { + return; + } + + if (arrayBuffer == null || arrayBuffer.isDetached()) { + length = 0; + return; + } + + int bufferByteLength = arrayBuffer.getLength(); + int availableBytes = bufferByteLength - offset; + + if (availableBytes < 0) { + length = 0; + return; + } + + length = availableBytes / getBytesPerElement(); } // Array properties implementation. @@ -524,6 +566,7 @@ private void setRange(Context cx, Scriptable scope, Scriptable source, double db } public boolean isTypedArrayOutOfBounds() { + updateLength(); // ES2025: Update length for auto-length views return arrayBuffer.isDetached() || outOfRange; } @@ -578,6 +621,7 @@ private static Object js_byteOffset(Scriptable thisObj) { private static Object js_length(Scriptable thisObj) { NativeTypedArrayView o = realThis(thisObj); + // updateLength() is called by isTypedArrayOutOfBounds() if (o.isTypedArrayOutOfBounds()) { return 0; } From a2e47da7bacc278d25f3cc65fb85151200081fde Mon Sep 17 00:00:00 2001 From: anivar Date: Wed, 3 Dec 2025 10:51:57 -0500 Subject: [PATCH 5/7] Refactor ES2025 auto-length TypedArray implementation - Fix auto-length logic to only apply to resizable ArrayBuffers - Add isResizable() public method to NativeArrayBuffer - Improve JavaDoc to follow Rhino's concise documentation style - Add helper method determineViewLength() for clearer logic - Update test262.properties: 32 additional tests now passing - Array: 4 tests (find family with resize callbacks) - TypedArray: 28 tests (from, of, and prototype methods) --- .../typedarrays/NativeArrayBuffer.java | 7 ++- .../typedarrays/NativeTypedArrayView.java | 54 +++++++++++++++---- tests/testsrc/test262.properties | 40 ++------------ 3 files changed, 52 insertions(+), 49 deletions(-) diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java index c8138fb969..6a2bdeecba 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeArrayBuffer.java @@ -473,11 +473,16 @@ private static Object js_resize( return Undefined.instance; } + /** Return true if this ArrayBuffer is resizable (ES2024). */ + public boolean isResizable() { + return maxByteLength >= 0; + } + // ES2024 ArrayBuffer.prototype.resizable getter private static Object js_resizable(Scriptable thisObj) { NativeArrayBuffer self = getSelf(thisObj); // A buffer is resizable if maxByteLength was specified in constructor - return self.maxByteLength >= 0; + return self.isResizable(); } // ES2024 ArrayBuffer.prototype.maxByteLength getter diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java index 14d7900413..973b7c907d 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java @@ -49,14 +49,14 @@ public abstract class NativeTypedArrayView extends NativeArrayBufferView private static final long serialVersionUID = -4963053773152251274L; /** - * The length, in elements, of the array. - * For auto-length views, this is recomputed dynamically via updateLength(). + * The length in elements of the array. For auto-length views (ES2025), this is recomputed + * dynamically when the backing resizable buffer changes size. */ protected int length; /** - * ES2025: Tracks whether this is an auto-length TypedArray view. - * Auto-length views dynamically compute their length based on the buffer size. + * True if this is an auto-length view (ES2025). Auto-length views are created when a + * TypedArray is constructed on a resizable ArrayBuffer without specifying a length. */ private final boolean isAutoLength; @@ -66,11 +66,15 @@ protected NativeTypedArrayView() { isAutoLength = false; } + /** + * Construct a TypedArray view over an ArrayBuffer. If len is negative, creates an auto-length + * view (ES2025) that tracks the buffer's size dynamically. + */ protected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen) { super(ab, off, byteLen); this.isAutoLength = (len < 0); + if (isAutoLength) { - // Compute initial length for auto-length views updateLength(); } else { this.length = len; @@ -78,9 +82,9 @@ protected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteL } /** - * ES2025: Update the length for auto-length TypedArray views. - * For fixed-length views, this is a no-op. - * For auto-length views backed by resizable buffers, recomputes length based on current buffer size. + * Recomputes the length for auto-length views (ES2025). For fixed-length views, this is a + * no-op. For auto-length views, calculates the element count based on the current buffer size + * and offset. */ protected void updateLength() { if (!isAutoLength) { @@ -248,7 +252,7 @@ static void init( proto, null, (lcx, ls, largs) -> { - throw ScriptRuntime.typeError("Fuck"); + throw ScriptRuntime.typeError("TypedArray constructor cannot be invoked directly"); }); proto.defineProperty("constructor", ta, DONTENUM); defineProtoProperty(ta, cx, "buffer", NativeTypedArrayView::js_buffer, null); @@ -383,6 +387,28 @@ protected interface RealThis { NativeTypedArrayView realThis(Scriptable thisObj); } + /** + * Determines the view length for TypedArray construction. Returns -1 for auto-length views + * (ES2025), which only applies to resizable buffers when length is omitted. + */ + private static int determineViewLength( + NativeArrayBuffer buffer, + int explicitLength, + int calculatedByteLength, + int bytesPerElement, + Object[] args) { + + if (isArg(args, 2)) { + return explicitLength; + } + + if (buffer.isResizable()) { + return -1; // Auto-length view + } else { + return calculatedByteLength / bytesPerElement; + } + } + protected static NativeTypedArrayView js_constructor( Context cx, Scriptable scope, @@ -461,7 +487,9 @@ protected static NativeTypedArrayView js_constructor( throw ScriptRuntime.rangeErrorById("msg.typed.array.bad.offset", byteOff); } - return constructable.construct(na, byteOff, newByteLength / bytesPerElement); + // Determine view length: -1 for auto-length (resizable buffers only) + int viewLength = determineViewLength(na, newLength, newByteLength, bytesPerElement, args); + return constructable.construct(na, byteOff, viewLength); } if (arg0 instanceof NativeArray) { @@ -565,8 +593,12 @@ private void setRange(Context cx, Scriptable scope, Scriptable source, double db } } + /** + * Check if this TypedArray view is out of bounds (ES2025). For auto-length views, updates the + * length before checking. Returns true if the buffer is detached or the offset is out of range. + */ public boolean isTypedArrayOutOfBounds() { - updateLength(); // ES2025: Update length for auto-length views + updateLength(); return arrayBuffer.isDetached() || outOfRange; } diff --git a/tests/testsrc/test262.properties b/tests/testsrc/test262.properties index 766cd81024..a9c962abf8 100644 --- a/tests/testsrc/test262.properties +++ b/tests/testsrc/test262.properties @@ -452,7 +452,7 @@ built-ins/AggregateError 2/25 (8.0%) newtarget-proto-fallback.js proto-from-ctor-realm.js -built-ins/Array 257/3077 (8.35%) +built-ins/Array 253/3077 (8.22%) fromAsync 95/95 (100.0%) length/define-own-prop-length-coercion-order-set.js prototype/at/coerced-index-resize.js @@ -481,22 +481,18 @@ built-ins/Array 257/3077 (8.35%) prototype/filter/resizable-buffer.js prototype/filter/resizable-buffer-grow-mid-iteration.js prototype/filter/resizable-buffer-shrink-mid-iteration.js - prototype/findIndex/callbackfn-resize-arraybuffer.js prototype/findIndex/predicate-call-this-strict.js strict prototype/findIndex/resizable-buffer.js prototype/findIndex/resizable-buffer-grow-mid-iteration.js prototype/findIndex/resizable-buffer-shrink-mid-iteration.js - prototype/findLastIndex/callbackfn-resize-arraybuffer.js prototype/findLastIndex/predicate-call-this-strict.js strict prototype/findLastIndex/resizable-buffer.js prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js - prototype/findLast/callbackfn-resize-arraybuffer.js prototype/findLast/predicate-call-this-strict.js strict prototype/findLast/resizable-buffer.js prototype/findLast/resizable-buffer-grow-mid-iteration.js prototype/findLast/resizable-buffer-shrink-mid-iteration.js - prototype/find/callbackfn-resize-arraybuffer.js prototype/find/predicate-call-this-strict.js strict prototype/find/resizable-buffer.js prototype/find/resizable-buffer-grow-mid-iteration.js @@ -2347,12 +2343,8 @@ built-ins/ThrowTypeError 2/14 (14.29%) unique-per-realm-function-proto.js unique-per-realm-non-simple.js non-strict -built-ins/TypedArray 255/1434 (17.78%) - from/from-array-mapper-makes-result-out-of-bounds.js - from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js - from/from-typedarray-mapper-makes-result-out-of-bounds.js +built-ins/TypedArray 227/1434 (15.83%) from/iterated-array-changed-by-tonumber.js - of/resized-with-out-of-bounds-and-in-bounds-indices.js prototype/at/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/at/coerced-index-resize.js prototype/at/resizable-buffer.js @@ -2380,13 +2372,11 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/entries/resizable-buffer-shrink-mid-iteration.js prototype/entries/return-abrupt-from-this-out-of-bounds.js prototype/every/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/every/callbackfn-resize.js prototype/every/resizable-buffer.js prototype/every/resizable-buffer-grow-mid-iteration.js prototype/every/resizable-buffer-shrink-mid-iteration.js prototype/every/return-abrupt-from-this-out-of-bounds.js prototype/fill/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/fill/absent-indices-computed-from-initial-length.js prototype/fill/coerced-value-start-end-resize.js prototype/fill/resizable-buffer.js prototype/fill/return-abrupt-from-this-out-of-bounds.js @@ -2395,7 +2385,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js - prototype/filter/callbackfn-resize.js prototype/filter/resizable-buffer.js prototype/filter/resizable-buffer-grow-mid-iteration.js prototype/filter/resizable-buffer-shrink-mid-iteration.js @@ -2408,7 +2397,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/find/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findIndex/BigInt/predicate-call-this-strict.js strict prototype/findIndex/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/findIndex/callbackfn-resize.js prototype/findIndex/predicate-call-this-strict.js strict prototype/findIndex/resizable-buffer.js prototype/findIndex/resizable-buffer-grow-mid-iteration.js @@ -2418,39 +2406,31 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/findLast/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findLastIndex/BigInt/predicate-call-this-strict.js strict prototype/findLastIndex/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/findLastIndex/callbackfn-resize.js prototype/findLastIndex/predicate-call-this-strict.js strict prototype/findLastIndex/resizable-buffer.js prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js - prototype/findLast/callbackfn-resize.js prototype/findLast/predicate-call-this-strict.js strict prototype/findLast/resizable-buffer.js prototype/findLast/resizable-buffer-grow-mid-iteration.js prototype/findLast/resizable-buffer-shrink-mid-iteration.js prototype/findLast/return-abrupt-from-this-out-of-bounds.js - prototype/find/callbackfn-resize.js prototype/find/predicate-call-this-strict.js strict prototype/find/resizable-buffer.js prototype/find/resizable-buffer-grow-mid-iteration.js prototype/find/resizable-buffer-shrink-mid-iteration.js prototype/find/return-abrupt-from-this-out-of-bounds.js prototype/forEach/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/forEach/callbackfn-resize.js prototype/forEach/resizable-buffer.js prototype/forEach/resizable-buffer-grow-mid-iteration.js prototype/forEach/resizable-buffer-shrink-mid-iteration.js prototype/forEach/return-abrupt-from-this-out-of-bounds.js prototype/includes/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/includes/coerced-searchelement-fromindex-resize.js - prototype/includes/index-compared-against-initial-length.js - prototype/includes/index-compared-against-initial-length-out-of-bounds.js prototype/includes/resizable-buffer.js prototype/includes/resizable-buffer-special-float-values.js prototype/includes/return-abrupt-from-this-out-of-bounds.js - prototype/includes/search-undefined-after-shrinking-buffer.js - prototype/includes/search-undefined-after-shrinking-buffer-index-is-oob.js prototype/indexOf/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/indexOf/coerced-searchelement-fromindex-grow.js prototype/indexOf/coerced-searchelement-fromindex-shrink.js @@ -2462,7 +2442,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/join/coerced-separator-shrink.js prototype/join/resizable-buffer.js prototype/join/return-abrupt-from-this-out-of-bounds.js - prototype/join/separator-tostring-once-after-resized.js prototype/keys/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/keys/resizable-buffer.js prototype/keys/resizable-buffer-grow-mid-iteration.js @@ -2471,13 +2450,10 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/lastIndexOf/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/lastIndexOf/coerced-position-grow.js prototype/lastIndexOf/coerced-position-shrink.js - prototype/lastIndexOf/negative-index-and-resize-to-smaller.js prototype/lastIndexOf/resizable-buffer.js prototype/lastIndexOf/resizable-buffer-special-float-values.js prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js - prototype/length/BigInt/resizable-array-buffer-auto.js prototype/length/BigInt/resizable-array-buffer-fixed.js - prototype/length/resizable-array-buffer-auto.js prototype/length/resizable-array-buffer-fixed.js prototype/length/resizable-buffer-assorted.js prototype/length/resized-out-of-bounds-1.js @@ -2489,7 +2465,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/map/BigInt/speciesctor-get-species-custom-ctor-length-throws.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js - prototype/map/callbackfn-resize.js prototype/map/resizable-buffer.js prototype/map/resizable-buffer-grow-mid-iteration.js prototype/map/resizable-buffer-shrink-mid-iteration.js @@ -2504,12 +2479,10 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/map/speciesctor-resizable-buffer-shrink.js prototype/reduce/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/reduceRight/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/reduceRight/callbackfn-resize.js prototype/reduceRight/resizable-buffer.js prototype/reduceRight/resizable-buffer-grow-mid-iteration.js prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js - prototype/reduce/callbackfn-resize.js prototype/reduce/resizable-buffer.js prototype/reduce/resizable-buffer-grow-mid-iteration.js prototype/reduce/resizable-buffer-shrink-mid-iteration.js @@ -2522,11 +2495,9 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/set/BigInt/number-tobigint.js prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} - prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-resized.js prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/BigInt/typedarray-arg-target-out-of-bounds.js prototype/set/array-arg-primitive-toobject.js - prototype/set/array-arg-value-conversion-resizes-array-buffer.js prototype/set/target-grow-mid-iteration.js prototype/set/target-grow-source-length-getter.js prototype/set/target-shrink-mid-iteration.js @@ -2536,7 +2507,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-set-values-same-buffer-other-type.js - prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-src-backed-by-resizable-buffer.js prototype/set/typedarray-arg-target-out-of-bounds.js @@ -2553,7 +2523,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/slice/speciesctor-resize.js prototype/some/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/some/callbackfn-resize.js prototype/some/resizable-buffer.js prototype/some/resizable-buffer-grow-mid-iteration.js prototype/some/resizable-buffer-shrink-mid-iteration.js @@ -2580,7 +2549,6 @@ built-ins/TypedArray 255/1434 (17.78%) prototype/toReversed/this-value-invalid.js prototype/toSorted/this-value-invalid.js prototype/values/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/values/make-in-bounds-after-exhausted.js prototype/values/make-out-of-bounds-after-exhausted.js prototype/values/resizable-buffer.js prototype/values/resizable-buffer-grow-mid-iteration.js @@ -2601,7 +2569,7 @@ built-ins/TypedArray 255/1434 (17.78%) resizable-buffer-length-tracking-1.js resizable-buffer-length-tracking-2.js -built-ins/TypedArrayConstructors 197/736 (26.77%) +built-ins/TypedArrayConstructors 195/736 (26.49%) ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-throws-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js {unsupported: [SharedArrayBuffer]} @@ -2769,7 +2737,6 @@ built-ins/TypedArrayConstructors 197/736 (26.77%) internals/HasProperty/key-is-lower-than-zero.js internals/HasProperty/key-is-minus-zero.js internals/HasProperty/key-is-not-integer.js - internals/HasProperty/resizable-array-buffer-auto.js internals/HasProperty/resizable-array-buffer-fixed.js internals/OwnPropertyKeys/BigInt/integer-indexes.js internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js @@ -2797,7 +2764,6 @@ built-ins/TypedArrayConstructors 197/736 (26.77%) internals/Set/key-is-symbol.js internals/Set/key-is-valid-index-prototype-chain-set.js internals/Set/key-is-valid-index-reflect-set.js - internals/Set/resized-out-of-bounds-to-in-bounds-index.js internals/Set/tonumber-value-throws.js built-ins/Uint8Array 58/66 (87.88%) From 1a52a953077c17286e2d60ecf3f647a2d6af1cd4 Mon Sep 17 00:00:00 2001 From: anivar Date: Wed, 3 Dec 2025 15:55:20 -0500 Subject: [PATCH 6/7] Fix TypedArray.at() to check out-of-bounds for resizable buffers - Updated js_at() to call validateAndGetLength() before accessing elements - Enhanced isTypedArrayOutOfBounds() to check if fixed-length TypedArrays on resizable buffers have gone out of bounds when buffer is resized - Properly throws TypeError when accessing out-of-bounds views per ES2024 --- .../typedarrays/NativeTypedArrayView.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java index 973b7c907d..8e97015355 100644 --- a/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java +++ b/rhino/src/main/java/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java @@ -55,8 +55,8 @@ public abstract class NativeTypedArrayView extends NativeArrayBufferView protected int length; /** - * True if this is an auto-length view (ES2025). Auto-length views are created when a - * TypedArray is constructed on a resizable ArrayBuffer without specifying a length. + * True if this is an auto-length view (ES2025). Auto-length views are created when a TypedArray + * is constructed on a resizable ArrayBuffer without specifying a length. */ private final boolean isAutoLength; @@ -252,7 +252,8 @@ static void init( proto, null, (lcx, ls, largs) -> { - throw ScriptRuntime.typeError("TypedArray constructor cannot be invoked directly"); + throw ScriptRuntime.typeError( + "TypedArray constructor cannot be invoked directly"); }); proto.defineProperty("constructor", ta, DONTENUM); defineProtoProperty(ta, cx, "buffer", NativeTypedArrayView::js_buffer, null); @@ -488,7 +489,8 @@ protected static NativeTypedArrayView js_constructor( } // Determine view length: -1 for auto-length (resizable buffers only) - int viewLength = determineViewLength(na, newLength, newByteLength, bytesPerElement, args); + int viewLength = + determineViewLength(na, newLength, newByteLength, bytesPerElement, args); return constructable.construct(na, byteOff, viewLength); } @@ -599,7 +601,19 @@ private void setRange(Context cx, Scriptable scope, Scriptable source, double db */ public boolean isTypedArrayOutOfBounds() { updateLength(); - return arrayBuffer.isDetached() || outOfRange; + if (arrayBuffer.isDetached() || outOfRange) { + return true; + } + + // For fixed-length views on resizable buffers, check if the buffer + // has been resized such that the view is now out of bounds + if (!isAutoLength && arrayBuffer.isResizable()) { + int bufferByteLength = arrayBuffer.getLength(); + int requiredByteLength = offset + (length * getBytesPerElement()); + return offset > bufferByteLength || requiredByteLength > bufferByteLength; + } + + return false; } /** @@ -1202,15 +1216,16 @@ private static Object js_subarray( private static Object js_at(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { NativeTypedArrayView self = realThis(thisObj); + long len = self.validateAndGetLength(); long relativeIndex = 0; if (args.length >= 1) { relativeIndex = (long) ScriptRuntime.toInteger(args[0]); } - long k = (relativeIndex >= 0) ? relativeIndex : self.length + relativeIndex; + long k = (relativeIndex >= 0) ? relativeIndex : len + relativeIndex; - if ((k < 0) || (k >= self.length)) { + if ((k < 0) || (k >= len)) { return Undefined.instance; } From 5defc488a6c575661fbf0ce8c7dacbf725b1a013 Mon Sep 17 00:00:00 2001 From: anivar Date: Wed, 3 Dec 2025 16:00:52 -0500 Subject: [PATCH 7/7] Update test262.properties: 59 tests now passing TypedArray out-of-bounds checking improvements enable 58 more tests to pass. All return-abrupt-from-this-out-of-bounds tests now passing across TypedArray prototype methods. Fixed-length TypedArray property tests on resizable buffers also passing. --- tests/testsrc/test262.properties | 63 +------------------------------- 1 file changed, 2 insertions(+), 61 deletions(-) diff --git a/tests/testsrc/test262.properties b/tests/testsrc/test262.properties index a9c962abf8..8c195cff38 100644 --- a/tests/testsrc/test262.properties +++ b/tests/testsrc/test262.properties @@ -2343,44 +2343,29 @@ built-ins/ThrowTypeError 2/14 (14.29%) unique-per-realm-function-proto.js unique-per-realm-non-simple.js non-strict -built-ins/TypedArray 227/1434 (15.83%) +built-ins/TypedArray 169/1434 (11.79%) from/iterated-array-changed-by-tonumber.js - prototype/at/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/at/coerced-index-resize.js prototype/at/resizable-buffer.js - prototype/at/return-abrupt-from-this-out-of-bounds.js prototype/byteLength/BigInt/resizable-array-buffer-auto.js - prototype/byteLength/BigInt/resizable-array-buffer-fixed.js prototype/byteLength/resizable-array-buffer-auto.js - prototype/byteLength/resizable-array-buffer-fixed.js prototype/byteLength/resizable-buffer-assorted.js prototype/byteLength/resized-out-of-bounds-1.js prototype/byteLength/resized-out-of-bounds-2.js prototype/byteOffset/BigInt/resizable-array-buffer-auto.js - prototype/byteOffset/BigInt/resizable-array-buffer-fixed.js prototype/byteOffset/resizable-array-buffer-auto.js - prototype/byteOffset/resizable-array-buffer-fixed.js prototype/byteOffset/resized-out-of-bounds.js - prototype/copyWithin/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/copyWithin/coerced-target-start-end-shrink.js prototype/copyWithin/coerced-target-start-grow.js prototype/copyWithin/resizable-buffer.js - prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js - prototype/entries/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/entries/resizable-buffer.js prototype/entries/resizable-buffer-grow-mid-iteration.js prototype/entries/resizable-buffer-shrink-mid-iteration.js - prototype/entries/return-abrupt-from-this-out-of-bounds.js - prototype/every/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/every/resizable-buffer.js prototype/every/resizable-buffer-grow-mid-iteration.js prototype/every/resizable-buffer-shrink-mid-iteration.js - prototype/every/return-abrupt-from-this-out-of-bounds.js - prototype/fill/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/fill/coerced-value-start-end-resize.js prototype/fill/resizable-buffer.js - prototype/fill/return-abrupt-from-this-out-of-bounds.js - prototype/filter/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/filter/BigInt/speciesctor-destination-resizable.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws.js @@ -2388,77 +2373,53 @@ built-ins/TypedArray 227/1434 (15.83%) prototype/filter/resizable-buffer.js prototype/filter/resizable-buffer-grow-mid-iteration.js prototype/filter/resizable-buffer-shrink-mid-iteration.js - prototype/filter/return-abrupt-from-this-out-of-bounds.js prototype/filter/speciesctor-destination-resizable.js prototype/filter/speciesctor-get-species-custom-ctor-invocation.js prototype/filter/speciesctor-get-species-custom-ctor-length-throws.js prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/find/BigInt/predicate-call-this-strict.js strict - prototype/find/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findIndex/BigInt/predicate-call-this-strict.js strict - prototype/findIndex/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findIndex/predicate-call-this-strict.js strict prototype/findIndex/resizable-buffer.js prototype/findIndex/resizable-buffer-grow-mid-iteration.js prototype/findIndex/resizable-buffer-shrink-mid-iteration.js - prototype/findIndex/return-abrupt-from-this-out-of-bounds.js prototype/findLast/BigInt/predicate-call-this-strict.js strict - prototype/findLast/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findLastIndex/BigInt/predicate-call-this-strict.js strict - prototype/findLastIndex/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/findLastIndex/predicate-call-this-strict.js strict prototype/findLastIndex/resizable-buffer.js prototype/findLastIndex/resizable-buffer-grow-mid-iteration.js prototype/findLastIndex/resizable-buffer-shrink-mid-iteration.js - prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js prototype/findLast/predicate-call-this-strict.js strict prototype/findLast/resizable-buffer.js prototype/findLast/resizable-buffer-grow-mid-iteration.js prototype/findLast/resizable-buffer-shrink-mid-iteration.js - prototype/findLast/return-abrupt-from-this-out-of-bounds.js prototype/find/predicate-call-this-strict.js strict prototype/find/resizable-buffer.js prototype/find/resizable-buffer-grow-mid-iteration.js prototype/find/resizable-buffer-shrink-mid-iteration.js - prototype/find/return-abrupt-from-this-out-of-bounds.js - prototype/forEach/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/forEach/resizable-buffer.js prototype/forEach/resizable-buffer-grow-mid-iteration.js prototype/forEach/resizable-buffer-shrink-mid-iteration.js - prototype/forEach/return-abrupt-from-this-out-of-bounds.js - prototype/includes/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/includes/coerced-searchelement-fromindex-resize.js prototype/includes/resizable-buffer.js prototype/includes/resizable-buffer-special-float-values.js - prototype/includes/return-abrupt-from-this-out-of-bounds.js - prototype/indexOf/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/indexOf/coerced-searchelement-fromindex-grow.js prototype/indexOf/coerced-searchelement-fromindex-shrink.js prototype/indexOf/resizable-buffer.js prototype/indexOf/resizable-buffer-special-float-values.js - prototype/indexOf/return-abrupt-from-this-out-of-bounds.js - prototype/join/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/join/coerced-separator-grow.js prototype/join/coerced-separator-shrink.js prototype/join/resizable-buffer.js - prototype/join/return-abrupt-from-this-out-of-bounds.js - prototype/keys/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/keys/resizable-buffer.js prototype/keys/resizable-buffer-grow-mid-iteration.js prototype/keys/resizable-buffer-shrink-mid-iteration.js - prototype/keys/return-abrupt-from-this-out-of-bounds.js - prototype/lastIndexOf/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/lastIndexOf/coerced-position-grow.js prototype/lastIndexOf/coerced-position-shrink.js prototype/lastIndexOf/resizable-buffer.js prototype/lastIndexOf/resizable-buffer-special-float-values.js - prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js - prototype/length/BigInt/resizable-array-buffer-fixed.js - prototype/length/resizable-array-buffer-fixed.js prototype/length/resizable-buffer-assorted.js prototype/length/resized-out-of-bounds-1.js prototype/length/resized-out-of-bounds-2.js - prototype/map/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/map/BigInt/speciesctor-destination-resizable.js prototype/map/BigInt/speciesctor-get-ctor-abrupt.js prototype/map/BigInt/speciesctor-get-species-custom-ctor-invocation.js @@ -2468,7 +2429,6 @@ built-ins/TypedArray 227/1434 (15.83%) prototype/map/resizable-buffer.js prototype/map/resizable-buffer-grow-mid-iteration.js prototype/map/resizable-buffer-shrink-mid-iteration.js - prototype/map/return-abrupt-from-this-out-of-bounds.js prototype/map/speciesctor-destination-resizable.js prototype/map/speciesctor-get-ctor-abrupt.js prototype/map/speciesctor-get-species-custom-ctor-invocation.js @@ -2477,26 +2437,19 @@ built-ins/TypedArray 227/1434 (15.83%) prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js prototype/map/speciesctor-resizable-buffer-grow.js prototype/map/speciesctor-resizable-buffer-shrink.js - prototype/reduce/BigInt/return-abrupt-from-this-out-of-bounds.js - prototype/reduceRight/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/reduceRight/resizable-buffer.js prototype/reduceRight/resizable-buffer-grow-mid-iteration.js prototype/reduceRight/resizable-buffer-shrink-mid-iteration.js - prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js prototype/reduce/resizable-buffer.js prototype/reduce/resizable-buffer-grow-mid-iteration.js prototype/reduce/resizable-buffer-shrink-mid-iteration.js - prototype/reduce/return-abrupt-from-this-out-of-bounds.js - prototype/reverse/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/reverse/resizable-buffer.js - prototype/reverse/return-abrupt-from-this-out-of-bounds.js prototype/set/BigInt/array-arg-primitive-toobject.js prototype/set/BigInt/bigint-tobiguint64.js prototype/set/BigInt/number-tobigint.js prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} - prototype/set/BigInt/typedarray-arg-target-out-of-bounds.js prototype/set/array-arg-primitive-toobject.js prototype/set/target-grow-mid-iteration.js prototype/set/target-grow-source-length-getter.js @@ -2509,30 +2462,23 @@ built-ins/TypedArray 227/1434 (15.83%) prototype/set/typedarray-arg-set-values-same-buffer-other-type.js prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js {unsupported: [SharedArrayBuffer]} prototype/set/typedarray-arg-src-backed-by-resizable-buffer.js - prototype/set/typedarray-arg-target-out-of-bounds.js - prototype/slice/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/slice/BigInt/speciesctor-destination-resizable.js prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws.js prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/slice/coerced-start-end-grow.js prototype/slice/coerced-start-end-shrink.js prototype/slice/resizable-buffer.js - prototype/slice/return-abrupt-from-this-out-of-bounds.js prototype/slice/speciesctor-destination-resizable.js prototype/slice/speciesctor-get-species-custom-ctor-length-throws.js prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js prototype/slice/speciesctor-resize.js - prototype/some/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/some/resizable-buffer.js prototype/some/resizable-buffer-grow-mid-iteration.js prototype/some/resizable-buffer-shrink-mid-iteration.js - prototype/some/return-abrupt-from-this-out-of-bounds.js - prototype/sort/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/sort/comparefn-grow.js prototype/sort/comparefn-resizable-buffer.js prototype/sort/comparefn-shrink.js prototype/sort/resizable-buffer-default-comparator.js - prototype/sort/return-abrupt-from-this-out-of-bounds.js prototype/subarray/BigInt/infinity.js prototype/subarray/coerced-begin-end-grow.js prototype/subarray/coerced-begin-end-shrink.js @@ -2541,19 +2487,15 @@ built-ins/TypedArray 227/1434 (15.83%) prototype/subarray/result-byteOffset-from-out-of-bounds.js prototype/Symbol.toStringTag/BigInt/name.js prototype/Symbol.toStringTag/name.js - prototype/toLocaleString/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/toLocaleString/resizable-buffer.js - prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js prototype/toLocaleString/user-provided-tolocalestring-grow.js prototype/toLocaleString/user-provided-tolocalestring-shrink.js prototype/toReversed/this-value-invalid.js prototype/toSorted/this-value-invalid.js - prototype/values/BigInt/return-abrupt-from-this-out-of-bounds.js prototype/values/make-out-of-bounds-after-exhausted.js prototype/values/resizable-buffer.js prototype/values/resizable-buffer-grow-mid-iteration.js prototype/values/resizable-buffer-shrink-mid-iteration.js - prototype/values/return-abrupt-from-this-out-of-bounds.js prototype/with/BigInt/early-type-coercion-bigint.js prototype/with/index-validated-against-current-length.js prototype/with/negative-index-resize-to-out-of-bounds.js @@ -2569,7 +2511,7 @@ built-ins/TypedArray 227/1434 (15.83%) resizable-buffer-length-tracking-1.js resizable-buffer-length-tracking-2.js -built-ins/TypedArrayConstructors 195/736 (26.49%) +built-ins/TypedArrayConstructors 194/736 (26.36%) ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-throws-sab.js {unsupported: [SharedArrayBuffer]} ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js {unsupported: [SharedArrayBuffer]} @@ -2737,7 +2679,6 @@ built-ins/TypedArrayConstructors 195/736 (26.49%) internals/HasProperty/key-is-lower-than-zero.js internals/HasProperty/key-is-minus-zero.js internals/HasProperty/key-is-not-integer.js - internals/HasProperty/resizable-array-buffer-fixed.js internals/OwnPropertyKeys/BigInt/integer-indexes.js internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js