Skip to content

Commit f15ef69

Browse files
fix: complete() returns rejected promise (w3c#732)
The current spec text read as if calling complete() twice would caused the interface to close down based on the second call. This just returns a rejected promise if the completeCalled is `true`.
1 parent 634a8a8 commit f15ef69

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,25 +3490,26 @@ <h2>
34903490
arguments.
34913491
</p>
34923492
<p data-tests="payment-response/complete-method-manual.https.html">
3493-
The <a>complete(result)</a> method MUST act as follows:
3493+
The <a><code>complete(<var>result</var>)</code></a> method MUST act
3494+
as follows:
34943495
</p>
34953496
<ol class="algorithm">
34963497
<li>Let <var>response</var> be the <a>context object</a>.
34973498
</li>
3499+
<li>If <var>response</var>.<a>[[\complete]]</a> is true, return <a>a
3500+
promise rejected with</a> an "<a>InvalidStateError</a>"
3501+
<a>DOMException</a>.
3502+
</li>
34983503
<li>Let <var>promise</var> be <a>a new promise</a>.
34993504
</li>
3500-
<li>If <var>response</var>.<a>[[\complete]]</a> is true, reject <var>
3501-
promise</var> with an "<a>InvalidStateError</a>"
3502-
<a>DOMException</a>.
3505+
<li>Set <var>response</var>.<a>[[\complete]]</a> to true.
35033506
</li>
35043507
<li data-tests=
35053508
"payment-request/payment-response/retry-method-manual.https.html">If
35063509
<var>response</var>.<a>[[\retryPromise]]</a> is not null, reject
35073510
<var>promise</var> with an "<a>InvalidStateError</a>"
35083511
<a>DOMException</a>.
35093512
</li>
3510-
<li>Otherwise, set <var>response</var>.<a>[[\complete]]</a> to true.
3511-
</li>
35123513
<li>Return <var>promise</var> and perform the remaining steps <a>in
35133514
parallel</a>.
35143515
</li>

0 commit comments

Comments
 (0)