Re: [heycam/webidl] Specify open dictionaries. (#180)

jyasskin commented on this pull request.

I think this is ready for another round of review.

> +    </pre>
+
+    Open dictionary keys and values can be constrained, although keys can only be
+    constrained among the three string types.
+    The following conversions have the described results:
+    <table class="data">
+        <thead><th>Value</th><th>Passed to type</th><th>Result</th></thead>
+        <tr>
+            <td><code>{"😞": 1}</code></td>
+            <td><code>{{OpenDictionary}}&lt;ByteString, double></code></td>
+            <td><emu-val>TypeError</emu-val></td>
+        </tr>
+        <tr>
+            <td><code>{"\uD83D": 1}</code></td>
+            <td><code>{{OpenDictionary}}&lt;USVString, double></code></td>
+            <td>[ "\uFFFD" ⇒ 1 ]</td>

Done.

> @@ -3249,7 +3256,6 @@ extended attribute’s [=takes a named argument list|named argument list=].
 
 Two types are <dfn id="dfn-distinguishable" export>distinguishable</dfn> if
 at most one of the two [=includes a nullable type=]
-or is a [=dictionary type=],

This seems to be redundant with the table.

> @@ -3280,7 +3286,7 @@ and at least one of the following three conditions is true:
                     <span>callback function</span>
             </div></th>
                 <th><div>
-                    <span>dictionary</span>
+                    <span>[open] dictionary</span>

Is this notation ok to say that open dictionaries are distinguishable like dictionaries?

> @@ -5219,6 +5226,17 @@ type.
         "Promise" "&lt;" ReturnType "&gt;"
 </pre>
 
+<pre class="grammar" id="prod-OpenDictionaryType">
+    OpenDictionaryType :
+        "OpenDictionary" "&lt;" Type OpenDictionaryTypeMaybeValue

Before switching this to require both arguments, I'd like a couple more people to agree with @tobie.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/180#pullrequestreview-2637640

Received on Tuesday, 4 October 2016 01:54:12 UTC