You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: document/js-api/index.bs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1387,9 +1387,8 @@ To <dfn export>parse a WebAssembly module</dfn> given a <a>byte sequence</a> |by
1387
1387
1. [=Construct a WebAssembly module object=] from |module| and |bytes|, and let |module| be the result.
1388
1388
1. Let |requestedModules| be a set.
1389
1389
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|.
1393
1392
1. Return {
1394
1393
<!-- Abstract Module Records -->
1395
1394
\[[Realm]]: |realm|,
@@ -1412,7 +1411,7 @@ To <dfn export>parse a WebAssembly module</dfn> given a <a>byte sequence</a> |by
1412
1411
\[[PendingAsyncDependencies]]: ~empty~,
1413
1412
}.
1414
1413
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.
1416
1415
1417
1416
Note: From HTML, it's not observable when [=parse a WebAssembly module=] begins, so any work perfomed in compilation may be performed off-thread.
1418
1417
</div>
@@ -1466,6 +1465,9 @@ WebAssembly Module Records have the following methods:
1466
1465
1. Let |module| be |record|.\[[ModuleSource]].
1467
1466
1. Let |imports| be a new, empty [=map=].
1468
1467
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.
1469
1471
1. If |imports|[|importedModuleName|] does not exist, set |imports|[|importedModuleName|] to a new, empty [=map=].
1470
1472
1. Let |importedModule| be [$GetImportedModule$](|record|, |importedModuleName|).
1471
1473
1. Let |value| be ? |importedModule|.\[[Environment]].GetBindingValue(|name|, true).
0 commit comments