-
-
Notifications
You must be signed in to change notification settings - Fork 31
Support [AllowResizable]
, [AllowShared]
, SharedArrayBuffer
, and AllowSharedBufferSource
#276
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
Conversation
@domenic Could you assign some reviewer(s) to this PR? I can't seem to do it myself. |
I'll still work on jsdom stuff, don't worry. I plan to review this tomorrow :) |
I appreciate the separate commits; it made reviewing this easier. If you're up for some rebase-fu, here are some minor notes:
Or, if you prefer, we can just do a big squash-and-merge with a sufficiently-detailed commit message. |
3fa69ce
to
2a4057d
Compare
Previously, ArrayBufferView objects were always returned as-is. However, we now need to emit dedicated conversions to support extended attributes such as [AllowResizable] and [AllowShared]. See https://webidl.spec.whatwg.org/#js-buffer-source-types
2a4057d
to
71c3e58
Compare
This also fixes the crash reported in jsdom#231.
71c3e58
to
47447ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff, thank you!
The repeated conversions for unions with primitives are a bit strange, but I see the follow the spec exactly. (I.e. https://webidl.spec.whatwg.org/#js-union steps 13.1 + 17.)
Probably some optimizations are possible for simple unions. But I think the right tactic there would be to work on the more general project of slimming down the generated code, driven by analyzing all of jsdom to see what are the worst offenders weighted by web platform prevalence.
SharedArrayBuffer
is now a separate IDL type, and[AllowShared] BufferSource
has been replaced with a newAllowSharedBufferSource
typedef.[AllowResizable]
and[AllowShared]
, which need to be checked bywebidl-conversions
. Thus, we now generate the appropriate conversion calls.allowResizable
to (Shared)ArrayBuffer conversions webidl-conversions#51.object
type in unions.object
type is in a union #231.