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 1f7dbcd

Browse files
committed
[js-api] Use the 'react' algorithm from WebIDL
1 parent 5d5ab1f commit 1f7dbcd

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
@@ -639,15 +639,17 @@ The verification of WebAssembly type requirements is deferred to the
639639
To <dfn>instantiate a promise of a module</dfn> |promiseOfModule| with imports |importObject|, perform the following steps:
640640

641641
1. Let |promise| be [=a new promise=].
642-
1. [=Upon fulfillment=] of |promiseOfModule| with value |module|:
643-
1. [=asynchronously instantiate a WebAssembly module|Instantiate the WebAssembly module=] |module| importing |importObject|, and let |innerPromise| be the result.
644-
1. [=Upon fulfillment=] of |innerPromise| with value |instance|.
645-
1. Let |result| be the {{WebAssemblyInstantiatedSource}} value «[ "{{WebAssemblyInstantiatedSource/module}}" → |module|, "{{WebAssemblyInstantiatedSource/instance}}" → |instance| ]».
646-
1. [=Resolve=] |promise| with |result|.
647-
1. [=Upon rejection=] of |innerPromise| with reason |reason|:
642+
1. [=React=] to |promiseOfModule|:
643+
* If |promiseOfModule| was fulfilled with value |module|:
644+
1. [=asynchronously instantiate a WebAssembly module|Instantiate the WebAssembly module=] |module| importing |importObject|, and let |innerPromise| be the result.
645+
1. [=React=] to |innerPromise|:
646+
* If |innerPromise| was fulfilled with value |instance|.
647+
1. Let |result| be the {{WebAssemblyInstantiatedSource}} value «[ "{{WebAssemblyInstantiatedSource/module}}" → |module|, "{{WebAssemblyInstantiatedSource/instance}}" → |instance| ]».
648+
1. [=Resolve=] |promise| with |result|.
649+
* If |innerPromise| was rejected with reason |reason|:
650+
1. [=Reject=] |promise| with |reason|.
651+
* If |promiseOfModule| was rejected with reason |reason|:
648652
1. [=Reject=] |promise| with |reason|.
649-
1. [=Upon rejection=] of |promiseOfModule| with reason |reason|:
650-
1. [=Reject=] |promise| with |reason|.
651653
1. Return |promise|.
652654
</div>
653655

0 commit comments

Comments
 (0)