Re: [heycam/webidl] Can a dictionary with default values ever have a not present member? (#852)

Fwiw, what Gecko implements is that when such a dictionary is created internally its "b" property is present (because that's guaranteed by the spec), and then its value needs to be set to something so it gets set to `""`, because it's the only sensible thing to do.

In particular, JS would see `{ b: "" }`.

In spec terms, using dictionaries for return values is a bit of a bolt-on: they were originally defined as argument bags and most of the verbiage is around that.  But since people want to use them as return values, I think we should go ahead and define carefully what happens when a dictionary is created (apart from via es-to-dictionary), stored, etc.  Basically, come up with a consistent model for what a "dictionary value" means, not restricted to the argument context.

@EdgarChen @petervanderbeken

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/852#issuecomment-598788049

Received on Friday, 13 March 2020 15:47:21 UTC