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

annevk commented on this pull request.



> @@ -7529,6 +7564,82 @@ iterable |iterable| and an iterator getter
 </div>
 
 
+<h4 id="es-open-dictionary">Open dictionaries — dictionary&lt;[|K|,] |V|&gt;</h4>
+
+IDL {{dictionary}}&lt;|K|, |V|&gt; values are represented by
+ECMAScript <emu-val>Object</emu-val> values.
+
+<div algorithm="convert object to open dictionary" id="es-to-open-dictionary">
+    An ECMAScript value |O| is [=converted to an IDL value|converted=] to an IDL <code>{{dictionary}}<|K|, |V|></code> value as follows:
+
+    1.  If [=Type=](|O|) is not <emu-val>Object</emu-val>,
+        <a lt="es throw">throw a <emu-val>TypeError</emu-val></a>.
+    1.  Let |result| be a new empty instance of <code>{{dictionary}}<|K|, |V|></code>.
+    1.  Let |entries| be [=EnumerableOwnProperties=](|O|, "key+value").

Right, I don't have an opinion here, but I think the current approach is different when it comes to getters and I don't know what is better. I just thought I'd raise it to see if anyone else had thoughts on that.

-- 
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

Received on Friday, 30 September 2016 07:42:44 UTC