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
@@ -303,15 +309,13 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
303
309
304
310
* \[[Module]] : a WebAssembly [=/module=]
305
311
* \[[Bytes]] : the source bytes of \[[Module]].
306
-
* \[[ModuleSourceClassName]] : the string "WebAssembly.Module"
307
312
308
313
<div algorithm>
309
314
To <dfn>construct a WebAssembly module object</dfn> from a module |module| and source bytes |bytes|, perform the following steps:
310
315
311
316
1. Let |moduleObject| be a new {{Module}} object.
312
317
1. Set |moduleObject|.\[[Module]] to |module|.
313
318
1. Set |moduleObject|.\[[Bytes]] to |bytes|.
314
-
1. Set |moduleObject|.\[[ModuleSourceClassName]] to "WebAssembly.Module".
315
319
1. Return |moduleObject|.
316
320
</div>
317
321
@@ -520,8 +524,8 @@ interface Module {
520
524
};
521
525
</pre>
522
526
523
-
Per ECMA-262 requirements for source phase import integration, the interface object for {{Module}} must have as its \[[Prototype]]be %AbstractModuleSource%, created as if by ObjectCreate(%AbstractModuleSource%), instead of %ObjectPrototype%.
524
-
In addition, the interface prototype object for {{Module}}must have as its \[[Prototype]]be %AbstractModuleSource.prototype%, created as if by ObjectCreate(%AbstractModuleSource.prototype%), instead of %ObjectPrototype%.
527
+
Per ECMA-262 requirements for Source Phase Imports ([[!SOURCEPHASEIMPORTS]]) integration, the interface prototype object for {{Module}} must have as its \[[Prototype]]set to [=%AbstractModuleSource%.prototype=], as if created by [$OrdinaryObjectCreate$]([=%AbstractModuleSource%.prototype=]), instead of [=%ObjectPrototype%=].
528
+
In addition, the interface object for {{Module}}should have as its \[[Prototype]]set to [=%AbstractModuleSource%=], as if created by [$OrdinaryObjectCreate$]([=%AbstractModuleSource%=]), instead of [=%ObjectPrototype%=].
525
529
526
530
<div algorithm>
527
531
The <dfn>string value of the extern type</dfn> |type| is
@@ -1325,11 +1329,9 @@ This document defines a host environment for WebAssembly. It enables a WebAssemb
1325
1329
1326
1330
<h2 id="esm-integration">Integration with ECMAScript modules</h2>
1327
1331
1328
-
Note: It is possible to implement the Wasm-ESM integration in two stages. In the first stage only source phase imports of Wasm are supported (`import source fibModule from "./fib.wasm"`). In the second stage, evaluation phase imports would be supported too (`import { fib } from "./fib.wasm"`). If initially implementing just source phase imports, the `GetExportedNames`, `ResolveExport`, `InitializeEnvironment`, and `ExecuteModule` abstract operations can be implemented as abstract operations unconditionally throwing a `SyntaxError` exception. In this case, module fetch and CSP integration is still required to be implemented as specified in this proposal. Implementers are encouraged to ship both stages at once, but it is deemed OK for implementers to initially ship the first stage and then quickly follow up with the second stage, if this aids "time to ship" in implementations.
1329
-
1330
-
WebAssembly modules can be used in a module graph with ECMAScript modules.
1332
+
WebAssembly modules can be used in a module graph with ECMAScript modules and Source Phase Imports.
1331
1333
1332
-
Because WebAssembly module instantiation is asynchronous, these semantics are built on the top-level await TC39 JavaScript proposal. [[!TLA]]
1334
+
Note: It is possible to implement the Wasm-ESM integration in two stages. In the first stage only source phase imports of Wasm are supported (`import source fibModule from "./fib.wasm"`). In the second stage, evaluation phase imports would be supported too (`import { fib } from "./fib.wasm"`). If initially implementing just source phase imports, the `GetExportedNames`, `ResolveExport`, `InitializeEnvironment`, and `ExecuteModule` abstract operations can be implemented as abstract operations unconditionally throwing a `SyntaxError` exception. In this case, module fetch and CSP integration is still required to be implemented as specified in this proposal. Implementers are encouraged to ship both stages at once, but it is deemed OK for implementers to initially ship the first stage and then quickly follow up with the second stage, if this aids "time to ship" in implementations.
1333
1335
1334
1336
<dfn export>WebAssembly Module Record</dfn>s are a subclass of [=Cyclic Module Record=] which contain WebAssembly code. WebAssembly Module Records have one additional internal slot:
1335
1337
* \[[WebAssemblyModule]] : a WebAssembly {{Module}} object
@@ -1446,4 +1448,8 @@ WebAssembly Module Records have the following methods:
Hosts should implement [$HostGetModuleSourceName$] such that whenever a WebAssembly {{Module}} object is provided with a \[[Module]] internal slot, the string "<code data-x="">WebAssembly.Module</code>" is always returned.
1454
+
1449
1455
Note: See corresponding modifications to HTML in <a href="https://github.com/whatwg/html/pull/4372">PR #4372</a>.
0 commit comments