[Bug 16725] Treat omitted dictionary the same as empty dictionary

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16725

--- Comment #5 from Jonas Sicking <jonas@sicking.cc> 2012-04-26 10:16:49 UTC ---
Indeed. I would even go so far as to say that it won't be rare to use
dictionaries for required arguments (though the common case will likely be for
optional ones).

But like you say, in those cases the dictionary itself isn't the required part,
but rather the dictionary plus one or more properties.

This can be described in prose right now by doing something like:

dictionary MyDict { boolean prop; };
someFunc(MyDict);

and say that if the "prop" argument is not defined an exception is thrown.
Maybe down the line we can add syntax for required dictionary arguments but I
feel like that is premature at this point.

So yeah, I think dictionary arguments should always be optional as far as the
IDL goes, and default to an empty dictionary. And passing undefined (and maybe
null) should result in the same behavior as an empty dictionary.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Thursday, 26 April 2012 10:17:00 UTC