-
Notifications
You must be signed in to change notification settings - Fork 32
Dictionary constructors do not contain parameters from the supertype's constructor #188
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
Comments
CC @srujzs |
Ah, it looks like we're not handling dictionary inheritance properly: https://webidl.spec.whatwg.org/#dfn-dictionary
I'll modify the title to be more general. We likely want to prioritize this for the next release. |
(I supposed this was a more general issue, but didn't check other dictionary constructors hehe) |
Hmm, I'm thinking about this a bit more and not quite sure what the right answer is. An example where this might be a bad idea is But external factory DragEventInit({
bool bubbles,
bool cancelable,
bool composed,
Window? view,
int detail,
int which,
bool ctrlKey,
bool shiftKey,
bool altKey,
bool metaKey,
bool modifierAltGraph,
bool modifierCapsLock,
bool modifierFn,
bool modifierFnLock,
bool modifierHyper,
bool modifierNumLock,
bool modifierScrollLock,
bool modifierSuper,
bool modifierSymbol,
bool modifierSymbolLock,
int screenX,
int screenY,
int clientX,
int clientY,
int button,
int buttons,
EventTarget? relatedTarget,
DataTransfer? dataTransfer,
}); Maybe the documentation is incomplete and it should really say that it can inherit from the parent like with |
… empty object when there are no fields (#197) Dictionaries can contain their supertypes' members as well and therefore, these constructors should accept them. https://webidl.spec.whatwg.org/#idl-dictionaries #188 We also emit some empty dictionary constructors, but because they are empty, they are treated as named constructors instead of object literal constructors. They should instead call JSObject() to create an empty object. Since some supertype fields are marked required, this is technically a breaking change as calling the same dictionary constructor requires those members now. Therefore, bump to 0.6.0-wip.
The
FilePropertyBag
constructor only accepts thelastModified
property, however since it extendsBlobPropertyBag
, it should also support (and "pass through"1)type
andendings
(MDN)Is there any way of expressing this in the generated code, or does this need a specific helper?
Footnotes
This pass-through is probably a noop, there's no need to call the super constructor for this in JS, it's just that these PropertyBags should merge all the constructor arguments as you go down the inheritance chain? ↩
The text was updated successfully, but these errors were encountered: