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
1. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETFUNC~\functype_1` and :math:`\ETFUNC~\functype_2` respectively:
147
+
148
+
a. Return true if and only if :math:`\vdashexterntypematch\ETFUNC~\functype_1\matchesexterntype\ETFUNC~\functype_2`.
149
+
150
+
2. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETTABLE~\tabletype_1` and :math:`\ETTABLE~\tabletype_2` respectively:
151
+
152
+
a. Return true if and only if :math:`\vdashexterntypematch\ETTABLE~\tabletype_1\matchesexterntype\ETTABLE~\tabletype_2`.
153
+
154
+
3. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETMEM~\memtype_1` and :math:`\ETMEM~\memtype_2` respectively:
155
+
156
+
a. Return true if and only if :math:`\vdashexterntypematch\ETMEM~\memtype_1\matchesexterntype\ETMEM~\memtype_2`.
157
+
158
+
4. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETGLOBAL~\globaltype_1` and :math:`\ETGLOBAL~\globaltype_2` respectively:
159
+
160
+
a. Return true if and only if :math:`\vdashexterntypematch\ETGLOBAL~\globaltype_1\matchesexterntype\ETGLOBAL~\globaltype_2`.
This function encapsulates the external type matching relation defined in the :ref:`Import Subtyping <match>` of the validation section, where the :math:`\vdashexterntypematch\externtype_1\matchesexterntype\externtype_2` judgment establishes compatibility between external types. This allows for explicit checking of type compatibility when linking modules or validating imports against exports.
Copy file name to clipboardExpand all lines: proposals/esm-integration/EXAMPLES.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ Wasm exports can be imported as accurate, immutable bindings to other wasm modul
177
177
178
178
### wasm imports <- JS re-exports <- wasm exports
179
179
180
-
Any wasm exports that are re-exported via a JS module will be available to the other wasm module as accuratebindings. If the binding is a mutable global, then that binding will be a live export binding in JS reflecting changes to the Wasm global value. When imported from JS, the first and second Wasm modules will yield the same Wasm identities for the multiply exported Wasm objects.
180
+
Any wasm exports that are re-exported via a JS module will be available to the other wasm module as accurate, immutable bindings. The wasm export gets wrapped into a JS object (e.g. `WebAssembly.Global`) and then unwrapped to the wasm import in the importing wasm module. When imported from JS, the first and second Wasm modules will yield the same object identities for the multiply exported Wasm objects.
181
181
182
182
#### Example
183
183
@@ -213,7 +213,7 @@ export {memoryExport} from "./b.wasm";
213
213
214
214
1. JS module is parsed
215
215
1. wasm module is parsed
216
-
1. wasm module has a lexical environment created for its exports. All direct exports are initially in TDZ, indirect exports are available as they resolve.
216
+
1. wasm module has a lexical environment created for its exports. All exports are initially in TDZ.
217
217
1. JS module is instantiated. All imports (including functions) from the wasm module are memory locations holding undefined.
218
218
1. wasm module is instantiated and evaluated. Snapshots of imports are taken. Export bindings are initialized.
219
219
1. JS module is evaluated.
@@ -250,9 +250,9 @@ export function functionExport() {
250
250
251
251
1. wasm module is parsed
252
252
1. JS module is parsed
253
-
1. JS module is instantiated.
254
-
1. wasm module has a lexical environment created for its exports. All direct exports are initially in TDZ, indirect exports are available as they resolve.
255
-
1. JS module is evaluated. wasm exports in TDZ lead to a ReferenceError if used.
253
+
1. JS module is instantiated.
254
+
1. wasm module has a lexical environment created for its exports. All exports are initially in TDZ.
255
+
1. JS module is evaluated. wasm exports lead to a ReferenceError if used.
256
256
1. wasm module is instantiated and evaluated; wasm-exported bindings are updated to their appropriate JS API-exposed values.
0 commit comments