Open JMLX42 opened 4 years ago
Replacing:
[Throws] constructor(DOMString type, optional WebGLContextEventInit eventInit = {});
with:
[Throws] constructor(DOMString type, optional WebGLContextEventInit eventInit = 0);
make the parsing works. My understanding is that maybe {}
is not a handled as a default value for args.
It looks like this part of the parsing is done here:
https://github.com/rustwasm/weedle/blob/master/src/argument.rs#L19
But I don't understand yet why 0
works but {}
does not work.
Default
is defined in common.rs and relies on DefaultValue
which is defined in literals.rs and does have a specific case for the empty dict initializer:
https://github.com/rustwasm/weedle/blob/master/src/literal.rs#L63
So it's still unclear why 0
works but not {}
.
Describe the Bug
The parsing of WebGLContextEvent.webidl:
fails the following error:
Steps to Reproduce
The problem appears to be the following content:
optional WebGLContextEventInit eventInit = {}
. Removing the default value declaration to haveoptional WebGLContextEventInit eventInit
makes the parsing work OK.Expected Behavior
The WebIDL is parsed properly and the corresponding AST is returned.