Skip to content

Don't throw oob exception when setting numeric indexes on TAs #647

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 1 commit into from
Nov 7, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Nov 5, 2024

Relevant spec section: https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-typedarraysetelement

It should only throw if the backing buffer is detached, which test262 tests for.

Fixes: #645

Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM but I would've liked it better if you'd waited until #646 was merged... I don't enjoy fixing merge conflicts.

This should probably come with a regression test, seeing test262 doesn't seem to test for it.

@saghul
Copy link
Contributor Author

saghul commented Nov 5, 2024

SGTM, I'll wait for your PR, apply it on top and add a couple of tests for it!

@saghul
Copy link
Contributor Author

saghul commented Nov 7, 2024

You already fixed this one Ben :-) Closing!

@saghul saghul closed this Nov 7, 2024
@saghul saghul reopened this Nov 7, 2024
@saghul
Copy link
Contributor Author

saghul commented Nov 7, 2024

@bnoordhuis Updated, can you PTAL once more?

Relevant spec section: https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-typedarraysetelement

It should only throw if Object.defineProperty is used and the TA is
detached or OOB if a RAB is used.

Fixes: #645
@saghul saghul merged commit e30da0e into master Nov 7, 2024
47 checks passed
@saghul saghul deleted the ta-no-throw-oob branch November 7, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeError: out-of-bound numeric index" on typed arrays in strict mode
2 participants