-
Notifications
You must be signed in to change notification settings - Fork 172
How to return a SharedArrayBuffer object #865
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
Comments
Since Web IDL never seems to say an IDL ArrayBuffer has to be an actual JavaScript ArrayBuffer, couldn't you just use |
Sure, but how do you write spec prose saying that the IDL |
Generally IDL objects have been 1:1 with ECMAScript objects, except for SharedArrayBuffer. That was instead represented as [AllowShared] ArrayBuffer, although that includes ArrayBuffer as well. This created a number of challenges, e.g., how to return a SharedArrayBuffer object. So we make these changes here that will also require corresponding downstream fixes: * SharedArrayBuffer is now its own type. * [AllowShared] only applies to buffer view types. * AllowSharedBufferSource takes over from [AllowShared] BufferSource. Fixes #865 and fixes #961.
Generally IDL objects have been 1:1 with ECMAScript objects, except for SharedArrayBuffer. That was instead represented as [AllowShared] ArrayBuffer, although that includes ArrayBuffer as well. This created a number of challenges, e.g., how to return a SharedArrayBuffer object. So we make these changes here that will also require corresponding downstream fixes: * SharedArrayBuffer is now its own type. * [AllowShared] only applies to buffer view types. * AllowSharedBufferSource takes over from [AllowShared] BufferSource. Downstream is tracked by #1320. Fixes #865 and fixes #961.
As far as I can tell a JS
SharedArrayBuffer
can enter IDL through an IDLArrayBuffer
that's effectively a pointer to the JS object.Now assuming #342 is fixed and you can use
[AllowShared] ArrayBuffer
as return value, what language do you use to return aSharedArrayBuffer
? Do you need to construct the JS object, then make an IDLArrayBuffer
object that points to it, and then return the IDL object?The text was updated successfully, but these errors were encountered: