1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00
ladybird/Libraries/LibWeb/WebAssembly/WebAssembly.idl
Ali Mohammad Pur 333ba93d49 LibWeb/WebAssembly: Define the hacky 'native' errors given in the spec
These cannot be implemented "correctly" as the set of native errors as
defined by ecma262 is closed, but we can get pretty close.
2025-05-08 03:35:11 -06:00

23 lines
983 B
Text

#import <WebAssembly/Instance.idl>
#import <WebAssembly/Module.idl>
#import <Fetch/Response.idl>
dictionary WebAssemblyInstantiatedSource {
required Module module;
required Instance instance;
};
// https://webassembly.github.io/spec/js-api/#webassembly-namespace
// https://webassembly.github.io/spec/web-api/index.html#streaming-modules
[Exposed=*, WithGCVisitor, WithFinalizer, WithInitializer]
namespace WebAssembly {
// FIXME: Streaming APIs are supposed to be only exposed to Window, Worker
boolean validate(BufferSource bytes);
Promise<Module> compile(BufferSource bytes);
Promise<Module> compileStreaming(Promise<Response> source);
Promise<WebAssemblyInstantiatedSource> instantiate(BufferSource bytes, optional object importObject);
Promise<WebAssemblyInstantiatedSource> instantiateStreaming(Promise<Response> source, optional object importObject);
Promise<Instance> instantiate(Module moduleObject, optional object importObject);
};