Re: [heycam/webidl] Import the Promises Guide. (#772)

domenic commented on this pull request.



> +    <pre highlight="webidl">
+        interface I {
+          Promise&lt;void> delay(unrestricted double ms);
+        };
+    </pre>
+
+<div algorithm="delay">
+
+    The <code>delay(|ms|)</code> method steps are:
+
+    1.  Let |realm| be <b>this</b>'s [=relevant Realm=].
+    1.  If |ms| is NaN, let |ms| be +0; otherwise let |ms| be the maximum of |ms| and +0.
+    1.  Let |p| be [=Promise/a new promise=] in |realm|.
+    1.  Run the following steps [=in parallel=]:
+        1.  Wait |ms| milliseconds.
+        1.  [=Promise/Resolve=] |p| with the {{void}} value.

I'll push a commit that implements what I had in mind; please review and tell me what you think.

-- 
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/772#discussion_r317662974

Received on Monday, 26 August 2019 15:38:37 UTC