Skip to content

Add coverage for some implementation bugs in Array and TypedArray methods #4477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 30, 2025

Conversation

anba
Copy link
Contributor

@anba anba commented May 12, 2025

Coverage for some implementation bugs in JSC, V8, and SpiderMonkey.

@anba anba requested a review from a team as a code owner May 12, 2025 14:04
ljharb added a commit to es-shims/Array.prototype.with that referenced this pull request May 12, 2025
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not review the TypedArray tests. verified the with and setFromHex tests against my polyfills

ljharb added a commit to es-shims/es-arraybuffer-base64 that referenced this pull request May 12, 2025
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 13, 2025
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 13, 2025
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 13, 2025
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 13, 2025
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 13, 2025
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 13, 2025
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 13, 2025
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 13, 2025
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 1c03eb73265d4c6d57cff099c3f00aaced99075f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: 192b5d74f9ca4a7594142bf8fd789e2d5ab20b9c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 4c54c405baf8acea20927e66c1dc6e9b88c25b25
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: a7c3286c781fa3d67f2b75540b9be2c476e523a0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 1c03eb73265d4c6d57cff099c3f00aaced99075f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: 192b5d74f9ca4a7594142bf8fd789e2d5ab20b9c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 4c54c405baf8acea20927e66c1dc6e9b88c25b25
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: a7c3286c781fa3d67f2b75540b9be2c476e523a0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 1c03eb73265d4c6d57cff099c3f00aaced99075f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: 192b5d74f9ca4a7594142bf8fd789e2d5ab20b9c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 14, 2025
…ototype.with. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248928

UltraBlame original commit: 4c54c405baf8acea20927e66c1dc6e9b88c25b25
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 14, 2025
… array in lastIndexOf. r=jandem

Test case in <tc39/test262#4477>.

Differential Revision: https://phabricator.services.mozilla.com/D248929

UltraBlame original commit: a7c3286c781fa3d67f2b75540b9be2c476e523a0
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request May 15, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request May 15, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request May 15, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request May 15, 2025
anba added 7 commits May 30, 2025 11:10
SpiderMonkey doesn't handle this correctly for `Array.prototype.with`.
V8 doesn't handle this correctly for zero length typed arrays.
…ed)Array.prototype.with

JSC doesn't handle this correctly for `TypedArray.prototype.with`.
…rototype.with

V8 doesn't handle this case correctly.
SpiderMonkey doesn't handle this case correctly.
…backing buffer

JSC doesn't handle this case correctly.
…ype.subarray

JSC doesn't handle this case correctly.
@ptomato ptomato force-pushed the typedarray-coverage branch from 34f0eb1 to 64accef Compare May 30, 2025 09:10
@ptomato ptomato merged commit 19a9114 into tc39:main May 30, 2025
11 checks passed
@anba anba deleted the typedarray-coverage branch June 4, 2025 12:37
@nickva
Copy link
Contributor

nickva commented Jun 19, 2025

Regarding the byteOffset subarray test for detached buffers, apparently QuickJS also didn't conform so I updated to do so in bellard/quickjs#418.

However, I was also wondering if that is a spec omission and asked in es.discourse.group. At first sight it seems a bit odd to preserve the byteOffset of detached buffers. There weren't many responses there so thought I'd mention it here as well. Sorry for noise.

@ptomato
Copy link
Contributor

ptomato commented Jun 24, 2025

Regarding the byteOffset subarray test for detached buffers, apparently QuickJS also didn't conform so I updated to do so in bellard/quickjs#418.

However, I was also wondering if that is a spec omission and asked in es.discourse.group. At first sight it seems a bit odd to preserve the byteOffset of detached buffers. There weren't many responses there so thought I'd mention it here as well. Sorry for noise.

You might get more response there if you included a code sample that would show the difference. Personally I find the ArrayBuffer spec language difficult to reason about.

@gibson042
Copy link
Contributor

gibson042 commented Jun 24, 2025

Personally I find the ArrayBuffer spec language difficult to reason about.

I've been slowly working on that, and just opened tc39/ecma262#3629 for some preliminary feedback.

@nickva
Copy link
Contributor

nickva commented Jun 26, 2025

@ptomato thanks for the tip, tried to add a little snippet, basically a smaller version of the test. Since it involved "detaching" a buffer at some point, it assumes there is some test or host engine facility to do that. In my example I used the QuickJS test262 runner convention.

https://es.discourse.group/t/typedarray-subarray-byteoffset-with-detached-buffers/2381/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants