Skip to content

Commit 23275ba

Browse files
author
Guy Bedford
committed
change wasm: error back to instantiation time
1 parent 94689af commit 23275ba

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

document/js-api/index.bs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,9 +1387,8 @@ To <dfn export>parse a WebAssembly module</dfn> given a <a>byte sequence</a> |by
13871387
1. [=Construct a WebAssembly module object=] from |module| and |bytes|, and let |module| be the result.
13881388
1. Let |requestedModules| be a set.
13891389
1. For each (|moduleName|, <var ignore>name</var>, <var ignore>type</var>) in [=module_imports=](|module|.\[[Module]]),
1390-
1. If |moduleName| starts with the string "wasm:",
1391-
1. Throw a {{CompileError}} exception.
1392-
1. [=set/Append=] |moduleName| to |requestedModules|.
1390+
1. If |moduleName| does not start with the builtin string prefix "wasm:",
1391+
1. [=set/Append=] |moduleName| to |requestedModules|.
13931392
1. Return {
13941393
<!-- Abstract Module Records -->
13951394
\[[Realm]]: |realm|,
@@ -1412,7 +1411,7 @@ To <dfn export>parse a WebAssembly module</dfn> given a <a>byte sequence</a> |by
14121411
\[[PendingAsyncDependencies]]: ~empty~,
14131412
}.
14141413

1415-
Node: When integrating with the JS String Builtins proposal, "<code data-x="">builtins: ["js-string"]</code>" should be provided in the above WebAssembly compilation options, with the corresponding builtin names permitted.
1414+
Node: When integrating with the JS String Builtins proposal, "<code data-x="">builtins: ["js-string"]</code>" should be provided in the WebAssembly compilation options, with the corresponding builtin names permitted.
14161415

14171416
Note: From HTML, it's not observable when [=parse a WebAssembly module=] begins, so any work perfomed in compilation may be performed off-thread.
14181417
</div>
@@ -1466,6 +1465,9 @@ WebAssembly Module Records have the following methods:
14661465
1. Let |module| be |record|.\[[ModuleSource]].
14671466
1. Let |imports| be a new, empty [=map=].
14681467
1. For each (|importedModuleName|, |name|, <var ignore>type</var>) in [=module_imports=](|module|.\[[Module]]),
1468+
1. If |moduleName| starts with the string "wasm:",
1469+
Note: when integrating with the JS String Builtins proposal, string builtins should be excluded from erroring here.
1470+
1. Throw a {{LinkError}} exception.
14691471
1. If |imports|[|importedModuleName|] does not exist, set |imports|[|importedModuleName|] to a new, empty [=map=].
14701472
1. Let |importedModule| be [$GetImportedModule$](|record|, |importedModuleName|).
14711473
1. Let |value| be ? |importedModule|.\[[Environment]].GetBindingValue(|name|, true).

0 commit comments

Comments
 (0)