[whatwg/webidl] Definition of {} is slightly ambiguous (Issue #1344)

We have "If the argument at index i is declared with a default value, then append to values that default value." in https://webidl.spec.whatwg.org/#dfn-overload-resolution-algorithm. When the default value is `{}`, the only meaning I can find is in https://webidl.spec.whatwg.org/#dfn-optional-argument-default-value
> Optional argument default values can also be specified using the two token value {}, which represents a default-initialized (as if from ES null or an object with no properties) dictionary value.

Conversion from ES `null` is fully defined by https://webidl.spec.whatwg.org/#es-to-dictionary, but an "object with no properties"--if that means what you get by typing `{}` in ECMAScript--can be modified by changing `Object.prototype`. We should ensure this is specified so that `Object.prototype` doesn't affect it. A simple way to do that might be to remove "or an object with no properties" from the parenthetical, but it might be better to actually spell it out.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1344
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1344@github.com>

Received on Monday, 17 July 2023 17:38:34 UTC