You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"create an event" does not work with required members #600
Let defaultEventInitDict be the result of converting the JavaScript value undefined to the dictionary type accepted by eventInterface’s constructor. (This dictionary type will either be EventInit or a dictionary that inherits from it.)
We can deal with it failing, but that does seem to suggest that if you have a required dictionary member, you need to supply defaults in some other way than IDL. Alternatively we need to allow passing these members in some way to "fire an event" et al which would be the second refactoring to that whole operation within a rather sad short time period.
Why not let "create an event" just take a dictionary override:
let initDict be a new SomeKindOfEventInitDict.
Set initDict["requiredThing"] be "the required thing".
"Create an event" with MyEventInteface ... deal with optional realm ... and initDict, and set ev to the resulting event.
And then change:
If dictionary was not passed, let dictionary be the result of converting the JavaScript value undefined to the dictionary type accepted by eventInterface’s constructor. (This dictionary type will either be EventInit or a dictionary that inherits from it.)
That would probably work, but then you can't use "fire an event" for those events. And if we wanted to enable that, which would make sense, we'd have to redefine how the IDL attributes are initialized and refactor all callers.
(Multiple optional arguments also gets a little ugly and might warrant some refactoring of the callers.)
Activity
marcoscaceres commentedon Aug 27, 2018
Why not let "create an event" just take a dictionary override:
And then change:
So then it just use the passes dictionary?
annevk commentedon Aug 27, 2018
That would probably work, but then you can't use "fire an event" for those events. And if we wanted to enable that, which would make sense, we'd have to redefine how the IDL attributes are initialized and refactor all callers.
(Multiple optional arguments also gets a little ugly and might warrant some refactoring of the callers.)