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-4
Original file line number
Diff line number
Diff line change
@@ -434,7 +434,8 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
434
434
1. [=list/iterate|For each=] |builtinSetName| of |builtinSetNames|,
435
435
1. Assert: |builtinOrStringImports| does not contain |builtinSetName|
436
436
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|
438
439
1. If |importedStringModule| is not null,
439
440
1. Let |exportsObject| be the result of [=instantiate imported strings=] with |module| and |importedStringModule|
440
441
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.
1725
1726
1726
1727
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.
1727
1728
1728
-
All builtin functions are grouped into sets. Every builtin set has a unique namethat [=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=].
1729
1730
1730
1731
<div algorithm>
1731
1732
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
1741
1742
1. Let |importModuleName| be |import|[0]
1742
1743
1. Let |importName| be |import|[1]
1743
1744
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|
1745
1747
1. Let |builtins| be the result of [=get the builtins for a builtin set=] |builtinSetName|
1746
1748
1. [=list/iterate|For each=] |builtin| of |builtins|
1747
1749
1. Let |builtinName| be |builtin|[0]
@@ -1803,7 +1805,7 @@ To <dfn>validate an import for builtins</dfn> with |import|, enabled builtins |b
1803
1805
1804
1806
<h3 id="builtins-js-string">String Builtins</h3>
1805
1807
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`.
0 commit comments