Skip to content

Commit 5abad96

Browse files
authored
Cannot resolve/reject a promise in parallel
1 parent 29afaf0 commit 5abad96

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

index.bs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8628,11 +8628,12 @@ JavaScript code.
86288628
The <code>delay(|ms|)</code> method steps are:
86298629

86308630
1. Let |realm| be [=this=]'s [=relevant Realm=].
8631+
1. Let |taskSource| be some appropriate [=task source=].
86318632
1. If |ms| is NaN, let |ms| be +0; otherwise let |ms| be the maximum of |ms| and +0.
86328633
1. Let |p| be [=a new promise=] in |realm|.
86338634
1. Run the following steps [=in parallel=]:
86348635
1. Wait |ms| milliseconds.
8635-
1. [=Resolve=] |p|.
8636+
1. [=Queue a task=] on |taskSource| to [=resolve=] |p|.
86368637
1. Return |p|.
86378638
</div>
86388639
</div>
@@ -8655,12 +8656,13 @@ JavaScript code.
86558656
The <code>validatedDelay(|ms|)</code> method steps are:
86568657

86578658
1. Let |realm| be [=this=]'s [=relevant Realm=].
8659+
1. Let |taskSource| be some appropriate [=task source=].
86588660
1. If |ms| is NaN, return [=a promise rejected with=] a {{TypeError}} in |realm|.
86598661
1. If |ms| &lt; 0, return [=a promise rejected with=] a {{RangeError}} in |realm|.
86608662
1. Let |p| be [=a new promise=] in |realm|.
86618663
1. Run the following steps [=in parallel=]:
86628664
1. Wait |ms| milliseconds.
8663-
1. [=Resolve=] |p|.
8665+
1. [=Queue a task=] on |taskSource| to [=resolve=] |p|.
86648666
1. Return |p|.
86658667
</div>
86668668
</div>
@@ -8688,13 +8690,11 @@ JavaScript code.
86888690
* If |promise| was fulfilled with value |v|, then:
86898691
1. Run the following steps [=in parallel=]:
86908692
1. Wait |ms| milliseconds.
8691-
1. [=Queue a task=] to run the following steps on |taskSource|:
8692-
1. [=Resolve=] |p| with |v|.
8693+
1. [=Queue a task=] on |taskSource| to [=resolve=] |p| with |v|.
86938694
* If |promise| was rejected with reason |r|, then:
86948695
1. Run the following steps [=in parallel=]:
86958696
1. Wait |ms| milliseconds.
8696-
1. [=Queue a task=] to run the following steps on |taskSource|:
8697-
1. [=Reject=] |p| with |r|.
8697+
1. [=Queue a task=] on |taskSource| to [=reject=] |p| with |r|.
86988698
1. Return |p|.
86998699
</div>
87008700
</div>
@@ -8726,14 +8726,16 @@ JavaScript code.
87268726
To create an <code>Environment</code> object in a [=Realm=] |realm|, perform the following
87278727
steps:
87288728

8729+
1. Let |taskSource| be some appropriate [=task source=].
87298730
1. Let |environment| be [=new=] <code>Environment</code> object in |realm|.
87308731
1. Set |environment|'s [=Environment/ready promise=] to [=a new promise=] in |realm|.
87318732
1. Run the following steps [=in parallel=]:
87328733
1. Do some asynchronous work.
8733-
1. If |environment| becomes ready successfully, [=resolve=] |environment|'s
8734-
[=Environment/ready promise=].
8735-
1. If |environment| fails to become ready, [=reject=] |environment|'s
8736-
[=Environment/ready promise=] with a "{{NetworkError!!exception}}" {{DOMException}}.
8734+
1. If |environment| becomes ready successfully, then [=queue a task=] on |taskSource| to
8735+
[=resolve=] |environment|'s [=Environment/ready promise=].
8736+
1. If |environment| fails to become ready, then [=queue a task=] on |taskSource| to
8737+
[=reject=] |environment|'s [=Environment/ready promise=] with a
8738+
"{{NetworkError!!exception}}" {{DOMException}}.
87378739
1. Return |environment|.
87388740
</div>
87398741
</div>
@@ -8756,6 +8758,7 @@ JavaScript code.
87568758

87578759
The <code>addBookmark()</code> method steps are:
87588760

8761+
1. Let |taskSource| be some appropriate [=task source=].
87598762
1. If this method was not invoked as a result of explicit user action, return
87608763
[=a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
87618764
1. If the document's mode of operation is standalone, return [=a promise rejected with=] a
@@ -8766,9 +8769,9 @@ JavaScript code.
87668769
1. Using |info|, and in a manner that is user-agent specific, allow the end user to make a
87678770
choice as to whether they want to add the bookmark.
87688771
1. If the end-user aborts the request to add the bookmark (e.g., they hit escape, or
8769-
press a "cancel" button), [=reject=] |promise| with an "{{AbortError}}"
8770-
{{DOMException}}.
8771-
1. Otherwise, [=resolve=] |promise|.
8772+
press a "cancel" button), then [=queue a task=] on |taskSource| to [=reject=]
8773+
|promise| with an "{{AbortError}}" {{DOMException}}.
8774+
1. Otherwise, [=queue a task=] on |taskSource| to [=resolve=] |promise|.
87728775
1. Return |promise|.
87738776
</div>
87748777
</div>
@@ -14718,6 +14721,7 @@ Anne van Kesteren,
1471814721
Olav Junker Kjær,
1471914722
Takayoshi Kochi,
1472014723
Magnus Kristiansen,
14724+
Raphael Kubo da Costa,
1472114725
Takeshi Kurosawa,
1472214726
Yves Lafon,
1472314727
Travis Leithead,

0 commit comments

Comments
 (0)