@@ -31,25 +31,24 @@ Non-web embeddings are not required to support these additional methods.
31
31
32
32
:cyclone : Added for milestone 2, developers must feature detect.
33
33
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.
36
35
37
36
```
38
- Promise<WebAssembly.Module> compile(Response source)
39
-
40
- Promise<WebAssembly.Module> compile(Promise<Response> source)
37
+ Promise<WebAssembly.Module> compileStreaming(source)
41
38
```
42
39
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
45
47
[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
46
48
object or a
47
49
[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
48
50
object (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 ` .
53
52
Renderer-side
54
53
security checks about tainting for cross-origin content are tied to the types
55
54
of filtered responses defined in
@@ -62,7 +61,7 @@ with the resulting `WebAssembly.Module` object. On failure, the `Promise` is
62
61
[ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise ) with a
63
62
` WebAssembly.CompileError ` .
64
63
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.
66
65
MIME type information is
67
66
[ ` extracted ` ] ( https://fetch.spec.whatwg.org/#concept-header-extract-mime-type )
68
67
from the ` Response ` , WebAssembly ` source ` data must have a MIME type of ` application/wasm ` ,
@@ -75,27 +74,29 @@ MIME type mismatch or `opaque` response types
75
74
76
75
:cyclone : Added for milestone 2, developers must feature detect.
77
76
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.
80
78
81
79
```
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
+ };
84
84
85
- Promise<{module:WebAssembly.Module, instance:WebAssembly.Instance}>
86
- instantiate(Promise<Response> source [, importObject])
85
+ Promise<InstantiatedSource> instantiateStreaming(source [, importObject])
87
86
```
88
87
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
91
95
[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
92
96
object or a
93
97
[ ` Response ` ] ( https://fetch.spec.whatwg.org/#response-class )
94
98
object (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 ` .
99
100
Renderer-side
100
101
security checks about tainting for cross-origin content are tied to the types
101
102
of filtered responses defined in
@@ -114,7 +115,7 @@ On failure, the `Promise` is
114
115
[ rejected] ( http://tc39.github.io/ecma262/#sec-rejectpromise ) with a
115
116
` WebAssembly.CompileError ` , ` WebAssembly.LinkError ` , or ` WebAssembly.RuntimeError ` , depending on the cause of failure.
116
117
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.
118
119
MIME type information is
119
120
[ ` extracted ` ] ( https://fetch.spec.whatwg.org/#concept-header-extract-mime-type )
120
121
from the ` Response ` , WebAssembly ` source ` data must have a MIME type of ` application/wasm ` ,
0 commit comments