-
Notifications
You must be signed in to change notification settings - Fork 160
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
Throwing when converting detached ArrayBuffers is not what browsers do #352
Comments
Previous to this commit, any API that accepted any of the buffer source types would also accept a SharedArrayBuffer. This was not the approach we want; instead, we want APIs to explicitly opt-in. Enabled by previous work creating annotated types, this adds the new [AllowShared] extended attribute to allow APIs to opt in to accepting SharedArrayBuffers. While here, this removes an unimplemented check for detached array buffers when converting from ES values to IDL types, fixing #352.
Is JavaScript now aligned with implementations on ArrayBuffer around this? I believe some folks still tried to make them throw for more things. |
Also note that for the APIs you tested browsers might not use IDL's copying infrastructure since that's not the option that yields the best performance. |
No. I thought we'd best remove any aspirational stuff at least for now, especially given the inconsistency.
It's independent of the copy/reference; it should occur whenever converting a buffer source type to IDL, which happens before any algorithm steps. |
So what happens instead, we'll just treat it as an empty buffer? I guess what I'm wondering about is whether we should leave some kind of issue marker in for the aspirational stuff or whether everyone is down with just giving up. |
Previous to this commit, any API that accepted any of the buffer source types would also accept a SharedArrayBuffer. This was not the approach we want; instead, we want APIs to explicitly opt-in. Enabled by previous work creating annotated types, this adds the new [AllowShared] extended attribute to allow APIs to opt in to accepting SharedArrayBuffers. While here, this removes an unimplemented check for detached array buffers when converting from ES values to IDL types, fixing #352.
Fixed by c59bdcb |
Test: https://jsbin.com/qusumat/edit?html,console
I will remove this in my upcoming [AllowShared] PR. I was already finding it weird that we threw for detached buffers, but not for detached typed arrays surrounding detached buffers.
The text was updated successfully, but these errors were encountered: