Skip to content

Commit 2f3990a

Browse files
Ms2gerbzbarsky
authored andcommitted
Editorial: Add an example of using ordered map syntax for dictionaries. (#775)
Ref. #142.
1 parent 21ffd9b commit 2f3990a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

index.bs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,6 +4767,20 @@ specific dictionary |D| if all of its [=map/entries=] correspond to [=dictionary
47674767
correct order and with the correct types, and with appropriate [=map/entries=] for any required
47684768
dictionary members.
47694769

4770+
<div class="example">
4771+
<pre highlight="webidl">
4772+
dictionary Descriptor {
4773+
DOMString name;
4774+
sequence&lt;unsigned long> serviceIdentifiers;
4775+
};
4776+
</pre>
4777+
4778+
A <code>Descriptor</code> dictionary could be created as in the following steps:
4779+
4780+
1. Let |identifiers| be « 1, 3, 7 ».
4781+
1. Return «[ "name" → "test", "serviceIdentifiers" → |identifiers| ]».
4782+
</div>
4783+
47704784
<p class="advisement">
47714785
As with [=optional argument/default value|operation argument default values=],
47724786
it is strongly suggested not to use <emu-val>true</emu-val> as the

0 commit comments

Comments
 (0)