Skip to content

Commit b261bbf

Browse files
committed
Upgrade WebAssembly JS IDLs
Also adds WebAssembly Web APIs for `instantiateStreaming` and `compileStreaming` (which are now stable).
1 parent 353a0cf commit b261bbf

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

inputfiles/idl/WebAssembly JavaScript Interface.widl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ dictionary ModuleImportDescriptor {
3636

3737
[LegacyNamespace=WebAssembly, Constructor(BufferSource bytes), Exposed=(Window,Worker,Worklet)]
3838
interface Module {
39-
static sequence<ModuleExportDescriptor> exports(Module module);
40-
static sequence<ModuleImportDescriptor> imports(Module module);
41-
static sequence<ArrayBuffer> customSections(Module module, USVString sectionName);
39+
static sequence<ModuleExportDescriptor> exports(Module moduleObject);
40+
static sequence<ModuleImportDescriptor> imports(Module moduleObject);
41+
static sequence<ArrayBuffer> customSections(Module moduleObject, DOMString sectionName);
4242
};
4343

4444
[LegacyNamespace=WebAssembly, Constructor(Module module, optional object importObject), Exposed=(Window,Worker,Worklet)]
@@ -77,12 +77,19 @@ interface Table {
7777
readonly attribute unsigned long length;
7878
};
7979

80+
enum ValueType {
81+
"i32",
82+
"i64",
83+
"f32",
84+
"f64"
85+
};
86+
8087
dictionary GlobalDescriptor {
81-
required USVString value;
88+
required ValueType value;
8289
boolean mutable = false;
8390
};
8491

85-
[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, optional any value), Exposed=(Window,Worker,Worklet)]
92+
[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, optional any v), Exposed=(Window,Worker,Worklet)]
8693
interface Global {
8794
any valueOf();
8895
attribute any value;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
partial namespace WebAssembly {
2+
Promise<Module> compileStreaming(Promise<Response> source);
3+
Promise<WebAssemblyInstantiatedSource> instantiateStreaming(
4+
Promise<Response> source, optional object importObject);
5+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@
375375
"url": "https://www.w3.org/TR/wasm-js-api-1/",
376376
"title": "WebAssembly JavaScript Interface"
377377
},
378+
{
379+
"url": "https://www.w3.org/TR/wasm-web-api-1/",
380+
"title": "WebAssembly Web API"
381+
},
378382
{
379383
"url": "https://webaudio.github.io/web-audio-api/",
380384
"title": "Web Audio"

0 commit comments

Comments
 (0)