WebAssembly.Instance object is a stateful, executable instance of a WebAssembly.Module.
WebAssembly.Instance() constructor function can be called to synchronously instantiate a given
WebAssembly.Module object. However, the primary way to get an
Instance is through the asynchronous
Important: Since instantiation for large modules can be expensive, developers should only use the
Instance() constructor when synchronous instantiation is absolutely required; the asynchronous
WebAssembly.instantiate() method should be used at all other times.
var myInstance = new WebAssembly.Instance(module, importObject);
WebAssembly.Moduleobject to be instantiated.
- importObject Optional
- An object containing the values to be imported into the newly-created
Instance, such as functions or
WebAssembly.Memoryobjects. There must be one matching property for each declared import of
moduleor else a WebAssembly.LinkError is thrown.
Instance instances inherit from the
Instance() constructor's prototype object — this can be modified to affect all
- Returns the function that created this object's instance. By default this is the
The definition of 'Instance' in that specification.
|Draft||Initial draft definition.|
|Feature||Android||Chrome for Android||Edge mobile||Firefox for Android||IE mobile||Opera Android||iOS Safari|
1. , this feature is behind the
2. Disabled in the Firefox 52 Extended Support Release (ESR).