Skip to content

Commit e6f42fc

Browse files
authored
Prepare for integration with String Builtins
2 parents 03354b6 + cf64b44 commit e6f42fc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

document/js-api/index.bs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,10 +1400,20 @@ To <dfn export>parse a WebAssembly module</dfn> given a <a>byte sequence</a> |by
14001400
1. Let |stableBytes| be a [=get a copy of the buffer source|copy of the bytes held by the buffer=] |bytes|.
14011401
1. [=Compile a WebAssembly module|Compile the WebAssembly module=] |stableBytes| and store the result as |module|.
14021402
1. If |module| is [=error=], throw a {{CompileError}} exception.
1403+
1. Note: When integrating with the JS String Builtins proposal, |builtinSetNames| should be passed in the following step as « "js-string" » and |importedStringModule| as null.
14031404
1. [=Construct a WebAssembly module object=] from |module| and |bytes|, and let |module| be the result.
14041405
1. Let |requestedModules| be a set.
1405-
1. For each (|moduleName|, <var ignore>name</var>, <var ignore>type</var>) in [=module_imports=](|module|.\[[Module]]),
1406+
1. For each (|moduleName|, |name|, |type|) in [=module_imports=](|module|.\[[Module]]),
1407+
1. If |moduleName| starts with the prefix "wasm-js:",
1408+
1. Throw a {{LinkError}} exception.
1409+
1. If |name| starts with the prefix "wasm:" or "wasm-js:",
1410+
1. Throw a {{LinkError}} exception.
1411+
1. Note: The following step only applies when integrating with the JS String Builtins proposal.
1412+
1. If [=Find a builtin=] with (|moduleName|, |name|, |type|) and builtins |module|.\[[BuiltinSets]] is not null, then [=iteration/continue=].
14061413
1. [=set/Append=] |moduleName| to |requestedModules|.
1414+
1. For each (|name|, <var ignore>type</var>) in [=module_exports=](|module|.\[[Module]])
1415+
1. If |name| starts with the prefix "wasm:" or "wasm-js:",
1416+
1. Throw a {{LinkError}} exception.
14071417
1. Let |moduleRecord| be {
14081418
<!-- WebAssembly Module Records -->
14091419
\[[Instance]]: ~empty~,
@@ -1489,6 +1499,8 @@ WebAssembly Module Records have the following methods:
14891499
1. Let |module| be |record|.\[[ModuleSource]].\[[Module]].
14901500
1. Let |imports| be « ».
14911501
1. [=list/iterate|For each=] (|importedModuleName|, |name|, |importtype|) in [=module_imports=](|module|),
1502+
1. Note: The following step only applies when integrating with the JS String Builtins proposal.
1503+
1. If [=Find a builtin=] with (|importedModuleName|, |name|) and builtins |module|.\[[BuiltinSets]] is not null, then [=iteration/continue=].
14921504
1. Let |importedModule| be [$GetImportedModule$](|record|, |importedModuleName|).
14931505
1. Let |resolution| be |importedModule|.ResolveExport(|name|).
14941506
1. Assert: |resolution| is a [=ResolvedBinding Record=], as validated during environment initialization.

0 commit comments

Comments
 (0)