diff --git a/index.bs b/index.bs index ca9dabfa..ed28ff06 100644 --- a/index.bs +++ b/index.bs @@ -1616,8 +1616,8 @@ or one of the three special floating point constant values (-Infinity, Infinity and NaN). Note: These values – in addition to strings and the empty sequence – can also be used to specify the -[=dictionary member/default value|default value of a dictionary member=] or [=optional argument/default value|of an optional argument=]. Note that strings and the -empty sequence [] cannot be used as the value of a +[=dictionary member/default value|default value of a dictionary member=] or [=optional argument/default value|of an optional argument=]. Note that strings, the +empty sequence [], and the default dictionary {} cannot be used as the value of a [=constant=]. The value of the boolean literal tokens true and @@ -2242,12 +2242,12 @@ corresponding argument omitted. conversion of undefined to be used (i.e., false).

-If the type of an argument is a [=dictionary type=] or a [=union type=] that has a dictionary as one +If the type of an argument is a [=dictionary type=] or a [=union type=] that has +a [=dictionary type=] as one of its [=flattened member types=], and that dictionary type and its ancestors have no [=required dictionary member|required members=], and the argument is either the final argument or is -followed only by [=optional arguments=], then the argument must be specified as optional. Such -arguments are always considered to have a [=optional argument/default value=] of an empty -dictionary, unless otherwise specified. +followed only by [=optional arguments=], then the argument must be specified as +optional and have a default value provided.
@@ -2255,11 +2255,10 @@ dictionary, unless otherwise specified. empty dictionary value when they wish only to use the dictionary’s default values. - Dictionary types cannot have a default value specified explicitly, so the - “unless otherwise specified” clause above can only be invoked for - a [=union type=] that has a - dictionary type as one of its [=flattened member types=]. - + Usually the default value provided will be {}, but in the + case of a [=union type=] that has a dictionary type as one of its + [=flattened member types=] a default value could be provided that + initializes some other member of the union.
When a boolean literal token (true or false), @@ -2303,13 +2302,20 @@ is an [=enumeration=], then its be one of the [=enumeration values|enumeration’s values=]. Optional argument default values can also be specified using the -two token value [], which represents an empty sequence +two token value [], which represents an empty sequence value. The type of this value is the same as the type of the optional argument it is being used as the default value of. That type must be a [=sequence type=], a [=nullable type=] whose [=nullable types/inner type=] is a [=sequence type=] or a [=union type=] or [=nullable type|nullable=] union type that has a [=sequence type=] in its [=flattened member types=]. +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. The type +of this value is the same as the type of the optional argument it is being used +as the default value of. That type must be a [=dictionary type=], or a [=union +type=] that has a [=dictionary type=] in its [=flattened member types=]. +
The following [=IDL fragment=] @@ -2337,6 +2343,31 @@ that has a [=sequence type=] in its [=flattened member types=].
+
+ + The following [=IDL fragment=] + defines an [=interface=] + with an operation that takes a dictionary argument: + + +
+        dictionary LookupOptions {
+          boolean caseSensitive = false;
+        };
+
+        [Exposed=Window]
+        interface AddressBook {
+          boolean hasAddressForName(USVString name, optional LookupOptions options = {});
+        };
+    
+ + If hasAddressForName is called with only one argument, the + second argument will be a default-initialized LookupOptions + dictionary, which will cause caseSensitive to be set to + false. +
+ The following extended attributes are applicable to operations: [{{Default}}], [{{Exposed}}], @@ -2349,6 +2380,7 @@ The following extended attributes are applicable to operations: ConstValue string "[" "]" + "{" "}" "null" @@ -4524,8 +4556,9 @@ an integer token, a decimal token, one of the three special floating point literal values (Infinity, -Infinity or NaN), -a string token or -the two token sequence [] used as the +a string token, the two +token sequence [], or the two token sequence {} is +used as the [=dictionary member/default value=], it is interpreted in the same way as for an [=operation=]’s [=optional argument/default value|optional argument default value=].