-
Notifications
You must be signed in to change notification settings - Fork 164
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
Is it true that dictionaries can't have a default value specified? #585
Comments
I think we decided not to have a default value (e.g., |
What always has a default value? In the current state of the IDL spec, optional dictionary arguments in trailing position always have a default value. I think that non-trailing-position ones should too. But dictionary-typed members of dictionaries do not have a default value, and there are specs relying on that at this point. Firefox used to give them a default value and we just stopped doing that because of those specs. See #76. However some other specs do want to default those to empty dictionary, I suspect. Hence this issue. |
For example, |
Good catch. Yeah, I think I assumed that they would act like The other option is to default with prose in the algorithm, though that seems less nice. |
"{}") and require it to be specified for the dictionary arguments that are required to be optional. Fixes whatwg#585 Fixes whatwg#602
"{}") and require it to be specified for the dictionary arguments that are required to be optional. Fixes whatwg#585 Fixes whatwg#602
There's informative text in https://heycam.github.io/webidl/#idl-operations that says:
however it seems to me that
null
would be a valid default value for a dictionary (meaning empty dictionary, once you go through the es-to-dictionary steps).@tobie @domenic @marcoscaceres @annevk
The text was updated successfully, but these errors were encountered: