@@ -31,25 +31,24 @@ Non-web embeddings are not required to support these additional methods.
3131
3232:cyclone : Added for milestone 2, developers must feature detect.
3333
34- In Web embeddings, the following overloads are added (in addition to the core
35- JS API method of the same name).
34+ In Web embeddings, the following methods are added.
3635
3736```
38- Promise<WebAssembly.Module> compile(Response source)
39-
40- Promise<WebAssembly.Module> compile(Promise<Response> source)
37+ Promise<WebAssembly.Module> compileStreaming(source)
4138```
4239
43- Developers can set the argument ` source ` with either a promise that resolves
44- with a
40+ ` source ` is unconditionally passed through the built-in value
41+ of ` Promise.resolve ` .
42+ If the result is not a ` Response ` object, then the returned ` Promise ` is
43+ [ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise )
44+ with a [ ` TypeError ` ] ( https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror ) .
45+ This allows developers to pass either a promise that resolves
46+ to a
4547[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
4648object or a
4749[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
4850object (which is automatically cast to a
49- promise).
50- If when unwrapped that ` Promise ` is not a ` Response ` object, then the returned ` Promise ` is
51- [ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise )
52- with a [ ` TypeError ` ] ( https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror ) .
51+ promise) for the ` source ` .
5352Renderer-side
5453security checks about tainting for cross-origin content are tied to the types
5554of filtered responses defined in
@@ -62,7 +61,7 @@ with the resulting `WebAssembly.Module` object. On failure, the `Promise` is
6261[ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise ) with a
6362` WebAssembly.CompileError ` .
6463
65- The ` Promise< Response> ` is used as the source of the bytes to compile.
64+ The resolved ` Response ` is used as the source of the bytes to compile.
6665MIME type information is
6766[ ` extracted ` ] ( https://fetch.spec.whatwg.org/#concept-header-extract-mime-type )
6867from the ` Response ` , WebAssembly ` source ` data must have a MIME type of ` application/wasm ` ,
@@ -75,27 +74,29 @@ MIME type mismatch or `opaque` response types
7574
7675:cyclone : Added for milestone 2, developers must feature detect.
7776
78- In Web embeddings, the following overloads are added (in addition to the core
79- JS API method of the same name).
77+ In Web embeddings, the following methods are added.
8078
8179```
82- Promise<{module:WebAssembly.Module, instance:WebAssembly.Instance}>
83- instantiate(Response source [, importObject])
80+ dictionary WebAssemblyInstantiatedSource {
81+ required WebAssembly.Module module;
82+ required WebAssembly.Instance instance;
83+ };
8484
85- Promise<{module:WebAssembly.Module, instance:WebAssembly.Instance}>
86- instantiate(Promise<Response> source [, importObject])
85+ Promise<InstantiatedSource> instantiateStreaming(source [, importObject])
8786```
8887
89- Developers can set the argument ` source ` with either a promise that resolves
90- with a
88+ ` source ` is unconditionally passed through the built-in value
89+ of ` Promise.resolve ` .
90+ If the result is not a ` Response ` object, then the returned ` Promise ` is
91+ [ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise )
92+ with a [ ` TypeError ` ] ( https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror ) .
93+ This allows developers to pass either a promise that resolves
94+ to a
9195[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
9296object or a
9397[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
9498object (which is automatically cast to a
95- promise).
96- If when unwrapped that ` Promise ` is not a ` Response ` object, then the returned ` Promise ` is
97- [ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise )
98- with a [ ` TypeError ` ] ( https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror ) .
99+ promise) for the ` source ` .
99100Renderer-side
100101security checks about tainting for cross-origin content are tied to the types
101102of filtered responses defined in
@@ -114,7 +115,7 @@ On failure, the `Promise` is
114115[ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise ) with a
115116` WebAssembly.CompileError ` , ` WebAssembly.LinkError ` , or ` WebAssembly.RuntimeError ` , depending on the cause of failure.
116117
117- The ` Promise< Response> ` is used as the source of the bytes to compile.
118+ The resolved ` Response ` is used as the source of the bytes to compile.
118119MIME type information is
119120[ ` extracted ` ] ( https://fetch.spec.whatwg.org/#concept-header-extract-mime-type )
120121from the ` Response ` , WebAssembly ` source ` data must have a MIME type of ` application/wasm ` ,
0 commit comments