-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Normative: Remove @@species from InitializeTypedArrayFromTypedArray #2677
Comments
A cursory look around finds that use of |
What about node’s Buffer, polyfilled to run in the browser? |
What about it? |
I’m very in favor of this change. It’s currently a huge ordeal to clone array buffer data in a manner that’s guaranteed not to invoke user code because of this behavior. |
@bakkot does it extend ArrayBuffer? I’m on mobile rn so i can’t check; i forget if it’s that or one of the typed array types. |
It extends UInt8Array; its underlying |
I mentioned exploits! There's actually a couple distinct ones (e.g.). I feel like "this feature has been used more often for exploits than for its actual intended use" is a pretty good reason to remove a feature. |
…FromTypedArray. r=mgaudet Implement the changes from <tc39/ecma262#2677> and <tc39/ecma262#2719>. The next patches will perform further clean-ups. Differential Revision: https://phabricator.services.mozilla.com/D152262
…FromTypedArray. r=mgaudet Implement the changes from <tc39/ecma262#2677> and <tc39/ecma262#2719>. The next patches will perform further clean-ups. Differential Revision: https://phabricator.services.mozilla.com/D152262
When creating a
TypedArray
(the target) from anotherTypedArray
(the source) in InitializeTypedArrayFromTypedArray, target gets a newly allocatedArrayBuffer
whose prototype is the source's buffer's species constructor's prototype, but that species constructor is never called. Also this only happens if the buffer is not aSharedArrayBuffer
.Pretty funny!
Anyway not sure what purpose it serves to only hook up the species prototype but never call the species constructor. AFAICT, in all other uses of SpeciesConstructor, we call Construct on it.
Alas, major engines agree on this comedy:
Still, I want to see we can remove this one weird use.
/cc @marjakh who initially discovered this.
The text was updated successfully, but these errors were encountered: