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

domenic commented on this pull request.



> +</p>
+
+<ol class="algorithm">
+    1.  Let |result| be [=!=] [=ObjectCreate=]([=%ObjectPrototype%=]).
+    1.  Repeat, for each [=record/mapping=] (|key|, |value|) in |D|:
+        1.  Let |esKey| be |key| [=converted to an ECMAScript value=].
+        1.  Let |esValue| be |value| [=converted to an ECMAScript value=].
+        1.  Let |created| be [=!=] [=CreateDataProperty=](|result|, |esKey|, |esValue|).
+        1.  Assert: |created| is <emu-val>true</emu-val>.
+    1.  Return |result|.
+</ol>
+
+<div class="example" id="example-es-record">
+    Passing the ECMAScript value <code>{b: 3, a: 4}</code> to a
+    <code>{{record}}&lt;DOMString, double></code> argument
+    would result in the IDL value <code>[ ("b", 3), ("a", 4) ]</code>.

I'm still hesitant about using notation that's reminiscent of JS arrays, and is not defined anywhere. Maybe use some exotic type of bracket (such as the french double quotes that ES uses), and define it in the same place you define the mapping notation?

-- 
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, 14 October 2016 20:22:48 UTC