Skip to content

Commit 5e81fb4

Browse files
nicolo-ribaudolittledan
authored andcommitted
Use synchronous instantiation
1 parent 26e6faa commit 5e81fb4

File tree

2 files changed

+3883
-11
lines changed

2 files changed

+3883
-11
lines changed

document/js-api/index.bs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,8 @@ To <dfn export>parse a WebAssembly module</dfn> given a an {{ArrayBuffer}} |byte
12781278
\[[RequestedModules]]: |requestedModules|,
12791279
\[[LoadedModules]]: &laquo; &raquo;,
12801280
\[[CycleRoot]]: ~empty~,
1281-
\[[HasTLA]]: true,
1282-
\[[AsyncEvaluation]]: true,
1281+
\[[HasTLA]]: false,
1282+
\[[AsyncEvaluation]]: false,
12831283
\[[TopLevelCapability]]: ~empty~
12841284
\[[AsyncParentModules]]: &laquo; &raquo;,
12851285
\[[PendingAsyncDependencies]]: ~empty~,
@@ -1334,9 +1334,8 @@ WebAssembly Module Records have the following methods:
13341334
<div algorithm=ExecuteModule>
13351335

13361336
<h3 id="module-execution">ExecuteModule ( [ |promiseCapability| ] ) Concrete Method</h3>
1337-
1. Assert: |promiseCapability| was provided.
1337+
1. Assert: |promiseCapability| was not provided.
13381338
1. Let |record| be this WebAssembly Module Record.
1339-
1. Assert: |record|.\[[HasTLA]] is true.
13401339
1. Let |module| be |record|.\[[WebAssemblyModule]].
13411340
1. Let |imports| be a new, empty [=map=].
13421341
1. For each (|importedModuleName|, |name|, <var ignore>type</var>) in [=module_imports=](|module|.\[[Module]]),
@@ -1350,13 +1349,9 @@ WebAssembly Module Records have the following methods:
13501349
1. For each |importedName| → |importedValue| of |value|,
13511350
1. Perform ! [$CreateDataPropertyOrThrow$](|moduleImportsObject|, |importedName|, |importedValue|).
13521351
1. Perform ! [$CreateDataPropertyOrThrow$](|importsObject|, |key|, |moduleImportsObject|).
1353-
1. [=Asynchronously instantiate a WebAssembly module=] |module| with imports |importsObject| and let |instancePromise| be the result.
1354-
1. [=Upon fulfillment=] of |instancePromise| with value |instance|:
1355-
1. For each |name| in the [=export name list=] of |record|,
1356-
1. Perform ! |record|.\[[Environment]].InitializeBinding(|name|, ! Get(|instance|.\[[Exports]], |name|)).
1357-
1. Perform ! [=Call=](|promiseCapability|.\[[Resolve]], undefined, &laquo; undefined &raquo;).
1358-
1. [=Upon rejection=] of |instancePromise| with reason |r|:
1359-
1. Perform ! [=Call=](|promiseCapability|.\[[Reject]], undefined, &laquo; |r| &raquo;).
1352+
1. Let |instance| be the result of [=Instantiate a WebAssembly module|instantiating the WebAssembly module=] |module| with imports |importsObject|.
1353+
1. For each |name| in the [=export name list=] of |record|,
1354+
1. Perform ! |record|.\[[Environment]].InitializeBinding(|name|, ! Get(|instance|.\[[Exports]], |name|)).
13601355

13611356
Note: exported bindings are left uninitialized, i.e., in TDZ.
13621357

0 commit comments

Comments
 (0)