WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d8ef842

Browse files
committed
[js-api] Use the 'react' algorithm from WebIDL
1 parent 4362b72 commit d8ef842

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

document/js-api/index.bs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,17 @@ The verification of WebAssembly type requirements is deferred to the
469469
To <dfn>instantiate a promise of a module</dfn> |promiseOfModule| with imports |importObject|, perform the following steps:
470470

471471
1. Let |promise| be [=a new promise=].
472-
1. [=Upon fulfillment=] of |promiseOfModule| with value |module|:
473-
1. [=asynchronously instantiate a WebAssembly module|Instantiate the WebAssembly module=] |module| importing |importObject|, and let |innerPromise| be the result.
474-
1. [=Upon fulfillment=] of |innerPromise| with value |instance|.
475-
1. Let |result| be the {{WebAssemblyInstantiatedSource}} value «[ "{{WebAssemblyInstantiatedSource/module}}" → |module|, "{{WebAssemblyInstantiatedSource/instance}}" → |instance| ]».
476-
1. [=Resolve=] |promise| with |result|.
477-
1. [=Upon rejection=] of |innerPromise| with reason |reason|:
472+
1. [=React=] to |promiseOfModule|:
473+
* If |promiseOfModule| was fulfilled with value |module|:
474+
1. [=asynchronously instantiate a WebAssembly module|Instantiate the WebAssembly module=] |module| importing |importObject|, and let |innerPromise| be the result.
475+
1. [=React=] to |innerPromise|:
476+
* If |innerPromise| was fulfilled with value |instance|.
477+
1. Let |result| be the {{WebAssemblyInstantiatedSource}} value «[ "{{WebAssemblyInstantiatedSource/module}}" → |module|, "{{WebAssemblyInstantiatedSource/instance}}" → |instance| ]».
478+
1. [=Resolve=] |promise| with |result|.
479+
* If |innerPromise| was rejected with reason |reason|:
480+
1. [=Reject=] |promise| with |reason|.
481+
* If |promiseOfModule| was rejected with reason |reason|:
478482
1. [=Reject=] |promise| with |reason|.
479-
1. [=Upon rejection=] of |promiseOfModule| with reason |reason|:
480-
1. [=Reject=] |promise| with |reason|.
481483
1. Return |promise|.
482484
</div>
483485

0 commit comments

Comments
 (0)