Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

TypedArray.prototype.with should convert v up front #85

Closed
syg opened this issue May 27, 2022 · 0 comments · Fixed by #86
Closed

TypedArray.prototype.with should convert v up front #85

syg opened this issue May 27, 2022 · 0 comments · Fixed by #86

Comments

@syg
Copy link
Contributor

syg commented May 27, 2022

TypedArray#with doesn't convert the value parameter until the Set call mid-iteration in step 10.b.i here. This means that you can pass in objects like { valueOf() { detach(TA.buffer); } which perform shenanigans mid-iteration, significantly complicating implementation.

We should convert value up front a la https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill

h/t @marjakh for noticing

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

Successfully merging a pull request may close this issue.

1 participant