Skip to main content

Module WebAssembly

Module WebAssembly 

Source

Structs§

CompileError
The WebAssembly.CompileError() constructor creates a new WebAssembly CompileError object, which indicates an error during WebAssembly decoding or validation.
CompileOptions
The compile options accepted by WebAssembly.validate(), compile(), instantiate(), their streaming forms and the Module constructor: the JS builtins to enable and the import module name for imported string constants.
Exception
The WebAssembly.Exception() constructor creates a new Exception object
Global
The WebAssembly.Global() constructor creates a new Global object of the given type and value.
Instance
A WebAssembly.Instance object is a stateful, executable instance of a WebAssembly.Module. Instance objects contain all the exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.
InstantiatedSource
The { module, instance } pair that WebAssembly.instantiate() and WebAssembly.instantiateStreaming() resolve to when given bytes rather than a compiled Module.
LinkError
The WebAssembly.LinkError() constructor creates a new WebAssembly LinkError object, which indicates an error during module instantiation (besides traps from the start function).
Memory
MDN documentation
Module
A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, and instantiated multiple times.
RuntimeError
The WebAssembly.RuntimeError() constructor creates a new WebAssembly RuntimeError object — the type that is thrown whenever WebAssembly specifies a trap.
Suspending
A WebAssembly.Suspending object wraps a JavaScript async function so it can be used as a WebAssembly import under JSPI (JS Promise Integration).
Table
The WebAssembly.Table() constructor creates a new Table object of the given size and element type.
Tag
The WebAssembly.Tag() constructor creates a new Tag object

Statics§

JS_TAG
The WebAssembly.JSTag property is the Tag under which JavaScript exceptions are thrown into and caught from Wasm code.

Functions§

compile
The WebAssembly.compile() function compiles a WebAssembly.Module from WebAssembly binary code. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the WebAssembly.instantiate() function should be used).
compile_streaming
The WebAssembly.compileStreaming() function compiles a WebAssembly.Module module directly from a streamed underlying source. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the WebAssembly.instantiateStreaming() function should be used).
compile_streaming_with_options
The WebAssembly.compileStreaming() function compiles a module from a streamed Response under the given compile options.
compile_with_options
The WebAssembly.compile() function compiles the given bytes under the given compile options.
instantiate_buffer
The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.
instantiate_buffer_with_options
The WebAssembly.instantiate() function compiles and instantiates the given bytes under the given compile options, resolving to an InstantiatedSource holding both the module and the instance.
instantiate_module
The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.
instantiate_streaming
The WebAssembly.instantiateStreaming() function compiles and instantiates a WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load Wasm code.
instantiate_streaming_with_options
The WebAssembly.instantiateStreaming() function compiles and instantiates a module from a streamed Response under the given compile options, resolving to an InstantiatedSource.
promising
Wraps a WebAssembly exported Function so that calling it returns a Promise and enables JSPI suspension inside.
validate
The WebAssembly.validate() function validates a given typed array of WebAssembly binary code, returning whether the bytes form a valid Wasm module (true) or not (false).
validate_with_options
The WebAssembly.validate() function validates the given bytes under the given compile options.