Re: [webidl] Sort out when dictionaries should have default values (#76)

> Would it be possible to say something like "when an ECMAScript value is not supplied for the
> argument, the corresponding Web IDL value is the empty dictionary"?

Sure.  We already say something like that that for dictionaries in trailing position, as I noted.

> although if there are cases where {} and undefined are treated differently, then I guess we are in trouble

The only cases where that happens are:

1.  A union which contains a dictionary and the default value is a value for one of the other types in the union.  But then conversion from IDL to JS would produce that default value, not undefined.
2. If someone adds properties on `Object.prototype`, because `undefined` always produces an empty dictionary while `{}` would then possibly produce a nonempty one.  But that would be a problem for arguments too; people should just not add properties on `Object.prototype` because that kills puppies.

---
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/76#issuecomment-158568396

Received on Saturday, 21 November 2015 00:50:38 UTC