Skip to content

Commit 91115df

Browse files
committed
Fix spec to separate builtin name used for imports and compile options
1 parent 9570169 commit 91115df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: document/js-api/index.bs

+6-4
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
434434
1. [=list/iterate|For each=] |builtinSetName| of |builtinSetNames|,
435435
1. Assert: |builtinOrStringImports| does not contain |builtinSetName|
436436
1. Let |exportsObject| be the result of [=instantiate a builtin set=] with |builtinSetName|
437-
1. [=map/set|Set=] |builtinOrStringImports|[|builtinSetName|] to |exportsObject|
437+
1. Let |builtinSetQualifiedName| be |builtinSetName| prefixed with "wasm:"
438+
1. [=map/set|Set=] |builtinOrStringImports|[|builtinSetQualifiedName|] to |exportsObject|
438439
1. If |importedStringModule| is not null,
439440
1. Let |exportsObject| be the result of [=instantiate imported strings=] with |module| and |importedStringModule|
440441
1. [=map/set|Set=] |builtinOrStringImports|[|importedStringModule|] to |exportsObject|
@@ -1725,7 +1726,7 @@ Note: It is not currently possible to define this behavior using Web IDL.
17251726

17261727
The JS-API defines sets of builtin functions which can be imported through {{WebAssemblyCompileOptions|options}} when compiling a module. WebAssembly builtin functions mirror existing JavaScript builtins, but adapt them to be useable directly as WebAssembly functions with minimal overhead.
17271728

1728-
All builtin functions are grouped into sets. Every builtin set has a unique name that [=read the imports|is used during import lookup=]. All names are prefixed by the `wasm:` namespace (e.g. `wasm:js-string`).
1729+
All builtin functions are grouped into sets. Every builtin set has a |name| that is used in {{WebAssemblyCompileOptions}}, and a |qualified name| with a `wasm:` prefix that [=read the imports|is used during import lookup=].
17291730

17301731
<div algorithm>
17311732
To <dfn>get the builtins for a builtin set</dfn> with |builtinSetName|, perform the following steps:
@@ -1741,7 +1742,8 @@ To <dfn>find a builtin</dfn> with |import| and enabled builtins |builtinSetNames
17411742
1. Let |importModuleName| be |import|[0]
17421743
1. Let |importName| be |import|[1]
17431744
1. [=list/iterate|For each=] |builtinSetName| of |builtinSetNames|,
1744-
1. If |importModuleName| equals |builtinSetName|
1745+
1. Let |builtinSetQualifiedName| be |builtinSetName| prefixed with "wasm:"
1746+
1. If |importModuleName| equals |builtinSetQualifiedName|
17451747
1. Let |builtins| be the result of [=get the builtins for a builtin set=] |builtinSetName|
17461748
1. [=list/iterate|For each=] |builtin| of |builtins|
17471749
1. Let |builtinName| be |builtin|[0]
@@ -1803,7 +1805,7 @@ To <dfn>validate an import for builtins</dfn> with |import|, enabled builtins |b
18031805

18041806
<h3 id="builtins-js-string">String Builtins</h3>
18051807

1806-
String builtins adapt the interface of the [=String=] builtin object. The import name for this set is `wasm:js-string`.
1808+
String builtins adapt the interface of the [=String=] builtin object. The |name| for this set is `js-string`.
18071809

18081810
<h4 id="builtins-js-string-abstract-ops">Abstract operations</h4>
18091811
<div algorithm>

0 commit comments

Comments
 (0)