Re: [heycam/webidl] Add the ability to construct a callback function (#328)

domenic commented on this pull request.



> @@ -12374,6 +12374,56 @@ described in the previous section).
             |rejectedPromise| to the callback function's return type.
 </div>
 
+Some callback functions are instead used as constructors. Such callback functions must not have
+a return type that is a [=promise type=].
+
+<div algorithm>
+
+    To <dfn id="construct-a-callback-function" export>construct</dfn> a
+    [=callback function type=] value |callable| with
+    a list of arguments |arg|<sub>0..|n|−1</sub>, each of which is either
+    an IDL value or the special value “missing” (representing a missing optional argument),
+    perform the following steps.
+    These steps will either return an IDL value or throw an exception.
+
+    1.  Let |completion| be an uninitialized variable.

I factored out the arguments conversion, which I think factors the most cleanly. The rest varies a bit too much IMO.

-- 
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/328#discussion_r107835088

Received on Friday, 24 March 2017 04:57:49 UTC