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

annevk commented on this pull request.



>  
-    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, « »):

Unless there's precedent for this pattern I'd prefer assigning the following steps to a variable and then using that variable in the creation of this builtin function.

>  </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=]

Maybe make the parenthetical a type assertion step?

-- 
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#pullrequestreview-277823533

Received on Wednesday, 21 August 2019 14:15:55 UTC