From bf2917bad2681e834abc7ae458dd3a7377faf36c Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Sat, 16 Feb 2019 17:50:15 +0100 Subject: [PATCH] [WIP] WebAssembly JavaScript Module integration 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 #4352. [1] https://github.com/webassembly/esm-integration [2] https://github.com/tc39/proposal-top-level-await --- source | 166 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 144 insertions(+), 22 deletions(-) diff --git a/source b/source index 87cb865d988..eae33fba6e2 100644 --- a/source +++ b/source @@ -2738,6 +2738,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

The following terms are defined in the WHATWG MIME Sniffing standard:

+
WebAssembly JavaScript Module Integration
+ +
+

The following terms are defined in WebAssembly JavaScript Module Integration:

+ + +
+
@@ -87523,6 +87536,9 @@ interface ApplicationCache : EventTarget {
  • a Source Text Module Record, for JavaScript module scripts;

  • +
  • a WebAssembly Module Record, for WebAssembly module scripts;

  • +
  • a Synthetic Module Record, for JSON module scripts; or

  • @@ -87580,13 +87596,17 @@ interface ApplicationCache : EventTarget { data-x="concept-script">script. It has no additional items.

    -

    Module scripts can be classified into two types:

    +

    Module scripts can be classified into three types: