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
For concreteness, this patch specifies how the WebAssembly JavaScript
module integration proposal [1] could work in HTML. It is not yet ready
to merge, as the proposal is still in a relatively early state.
Note that this change depends on the ability for modules to block in the
evaluation phase, to permit WebAssembly module instantiation to yield,
as is necessary on some platforms where compilation work is performed
during the first instantiation. Such an ability to yield is provided by
the JavaScript top-level await proposal [2] and associated HTML
integration patch whatwg#4352.
[1] https://github.com/webassembly/esm-integration
[2] https://github.com/tc39/proposal-top-level-await
<li><dfn data-x-href="https://webassembly.github.io/esm-integration/js-api/index.html#parse-a-webassembly-module">parse a WebAssembly module</dfn></li>
<var>requested</var> of <var>record</var>.[[RequestedModules]]:</p>
93087
+
93088
+
<ol>
93089
+
<li><p>Let <var>url</var> be the result of <span data-x="resolve a module specifier">resolving
93090
+
a module specifier</span> given <var>script</var>'s <span data-x="concept-script-base-url">base
93091
+
URL</span> and <var>requested</var>.[[Specifier]].</p></li>
93092
+
93093
+
<li><p>Let <var>moduleType</var> be the result of running the <span>module type from module
93094
+
request</span> steps given <var>requested</var>.</p></li>
93095
+
93096
+
<li>
93097
+
<p>If <var>url</var> is failure, or if the result of running the <span>module type
93098
+
allowed</span> steps given <var>moduleType</var> and <var>settings</var> is false, then:</p>
93099
+
93100
+
<ol>
93101
+
<li><p>Let <var>error</var> be a new <code>TypeError</code> exception.</p></li>
93102
+
93103
+
<li><p>Throw <var>error</var>.</p></li>
93104
+
</ol>
93105
+
</li>
93106
+
</ol>
93107
+
</li>
93108
+
</ol>
93109
+
93110
+
<p class="note">These steps are essentially validating all of the requested module specifiers and
93111
+
type assertions. We treat a module with unresolvable module specifiers or unsupported type
93112
+
assertions the same as one that cannot be parsed; in both cases, a syntactic issue makes it
93113
+
impossible to ever contemplate linking the module later.</p>
93114
+
92999
93115
<p>The <dfn>module type from module request</dfn> steps, given a <span>ModuleRequest
93000
93116
Record</span> <var>moduleRequest</var>, are as follows:</p>
93001
93117
@@ -126668,6 +126784,9 @@ INSERT INTERFACES HERE
126668
126784
<dt><dfn><code>application/xml</code></dfn></dt>
126669
126785
<dd>XML <ref spec=XML> <ref spec=RFC7303></dd>
126670
126786
126787
+
<dt><dfn><code>application/wasm</code></dfn></dt>
126788
+
<dd>WebAssembly <ref spec=WASM></dd>
126789
+
126671
126790
<dt><dfn><code>image/gif</code></dfn></dt>
126672
126791
<dd>GIF images <ref spec=GIF></dd>
126673
126792
@@ -127314,6 +127433,12 @@ INSERT INTERFACES HERE
127314
127433
<dt id="refsWASMJS">[WASMJS]</dt>
127315
127434
<dd>(Non-normative) <cite><a href="https://webassembly.github.io/spec/js-api/">WebAssembly JavaScript Interface</a></cite>, D. Ehrenberg. W3C.</dd>
127316
127435
127436
+
<dt id="refsWASM">[WASM]</dt>
127437
+
<dd><cite><a href="https://webassembly.github.io/spec/core/bikeshed/index.html">WebAssembly Core Specification</a></cite>, A. Rossberg. W3C.</dd>
127438
+
127439
+
<dt id="refsWASMESM">[WASMESM]</dt>
127440
+
<dd><cite><a href="https://webassembly.github.io/esm-integration/js-api/index.html">WebAssembly JavaScript Module Integration</a></cite>, L. Clark, D. Ehrenberg. W3C.</dd>
127441
+
127317
127442
<dt id="refsWCAG">[WCAG]</dt>
127318
127443
<dd>(Non-normative) <cite><a href="https://w3c.github.io/wcag/guidelines/">Web Content Accessibility Guidelines (WCAG)</a></cite>, A. Kirkpatrick, J. O Connor, A. Campbell, M. Cooper. W3C.</dd>
0 commit comments