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

Ms2ger commented on this pull request.



>  </div>
 
-<p class="issue">
-    Include an example of how to write spec text using this term.
-</p>
+<div algorithm>
+    To <dfn export for=Promise lt="a new promise">create</dfn> a new
+    <a interface lt="Promise">Promise&lt;<var ignore>T</var>&gt;</a> in a [=Realm=] |realm|,
+    perform the following steps:
+
+    1.  Let |constructor| be |realm|.\[[Intrinsics]].[[{{%Promise%}}]].
+    1.  Return [=?=] [$NewPromiseCapability$](|constructor|).
+</div>
+
+<div algorithm>
+    To create a <dfn export for=Promise>resolved promise</dfn> of type
+    <a interface lt="Promise">Promise&lt;|T|&gt;</a>, with |x| (a value of type |T|) in a [=Realm=]

I think it makes more sense to make it part of the "signature" of the algorithm, so to say.

>  
-    1.  Let |promise| be the promise object of type <a interface lt="Promise">Promise&lt;|T|&gt;</a>.
-    1.  Let |onFulfilled| be a new [=built-in function object=] whose
-        behavior when invoked is as follows:
+    1.  Let |onFulfilled| be [=!=] [$CreateBuiltinFunction$](the following steps, « »):

I thought there was precedent, but now I can't find it. Changed.

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

Received on Wednesday, 21 August 2019 14:30:39 UTC