Skip to content

Commit dadf3cb

Browse files
authored
Note interaction with import assertions (#45)
1 parent eee66a1 commit dadf3cb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

proposals/esm-integration/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ The ECMAScript specification holds the module's export in a lexical scope, as po
105105

106106
At the end of the link phase, the variables in the module's lexical scope are generally uninitialized. From JavaScript, accessing an uninitialized import causes a ReferenceError. JavaScript function declarations are initialized during the Link phase, as part of function hoisting, but WebAssembly function exports are not initialized until the Evaluation phase.
107107

108+
#### Import Assertions
109+
110+
[Import assertions](https://github.com/tc39/proposal-import-assertions) specify linking invariants that should be verified before evaluation can proceed. Currently HTML specifies a `"type"` assertion which is a requirement for CSS or JSON module imports due to their having different security privileges over full execution.
111+
112+
When importing WebAssembly from JavaScript, no assertion should be required since they share the same security privilege level in the ESM integration and in order to ensure transparent interoperability of the formats.
113+
114+
Future Wasm extensions may include supporting these assertions for imports from WebAssembly modules.
115+
108116
### Evaluate
109117

110118
During evaluation, the code is evaluated to assign values to the exported bindings. In JS, this means running the top-level module code.

0 commit comments

Comments
 (0)