-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: parse SharedArrayBuffer and validate AllowShared #747
Conversation
if (this.idlType === "BufferSource") { | ||
// XXX: For now this is a hack. Consider moving parents' extAttrs into types as the spec says: | ||
// https://webidl.spec.whatwg.org/#idl-annotated-types | ||
for (const extAttrs of [this.extAttrs, this.parent?.extAttrs]) { |
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.
Could this be [this.extAttrs, this.parent?.extAttrs].flat()
to avoid the second for loop?
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.
yeah, maybe also... to flatten to code a little more:
for (const extAttr of [this.extAttrs, this.parent?.extAttrs].flat()) {
if (extAttr.name !== "AllowShared") continue;
// the rest...
}
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.
That way the autofix won't know which array includes the attr and it'll need to rescan 😬
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.
Just a style nit.
Since w3c/webidl2.js#747, webidl2 treats SharedArrayBuffer as an inline type which breaks parsing of gecko IDLs.
Since w3c/webidl2.js#747, webidl2 treats SharedArrayBuffer as an inline type which breaks parsing of gecko IDLs.
This patch closes #746 and includes: