Fix DictionaryMember parser to match the WebIDL spec grammar#62
Merged
guybedford merged 1 commit intomasterfrom Feb 26, 2026
Merged
Fix DictionaryMember parser to match the WebIDL spec grammar#62guybedford merged 1 commit intomasterfrom
guybedford merged 1 commit intomasterfrom
Conversation
The WebIDL spec defines two productions for dictionary members:
DictionaryMemberRest ::
required TypeWithExtendedAttributes identifier ;
Type identifier Default ;
This means for required members, extended attributes like [EnforceRange]
go between 'required' and the type:
required [EnforceRange] unsigned long codedWidth;
Previously, weedle only accepted the non-spec order:
[EnforceRange] required unsigned long codedWidth;
This change replaces the macro-generated parser with a manual Parse
implementation that supports both orderings for backward compatibility.
Fixes wasm-bindgen/wasm-bindgen#5008.
guybedford
added a commit
to evilpie/wasm-bindgen
that referenced
this pull request
Feb 26, 2026
Bumps weedle to include wasm-bindgen/weedle#62, which fixes parsing of dictionary members like `required [EnforceRange] unsigned long codedWidth;` per the WebIDL spec grammar.
guybedford
added a commit
to evilpie/wasm-bindgen
that referenced
this pull request
Feb 26, 2026
Bumps weedle to include wasm-bindgen/weedle#62, which fixes parsing of dictionary members like `required [EnforceRange] unsigned long codedWidth;` per the WebIDL spec grammar.
guybedford
added a commit
to evilpie/wasm-bindgen
that referenced
this pull request
Feb 27, 2026
Bumps weedle to include wasm-bindgen/weedle#62, which fixes parsing of dictionary members like `required [EnforceRange] unsigned long codedWidth;` per the WebIDL spec grammar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DictionaryMemberparser to accept the spec-correctrequired [ExtAttrs] Type identifier ;syntax, in addition to the existing[ExtAttrs] required Type identifier ;orderParseimplementation that handles both productions from the WebIDL spec grammarVideoFrame.webidluses the spec-correct syntaxrequired [EnforceRange] unsigned long codedWidth;WebIDL spec grammar
For required members, extended attributes on the type go after
required, not before it. The previous parser only accepted them beforerequired.Backward compatibility
Both orderings are accepted:
required [EnforceRange] unsigned long foo;(spec-correct)[EnforceRange] required unsigned long foo;(old weedle order, still supported)When type-level attributes are present (spec position), they are merged into the
attributesfield so downstream consumers don't need changes.