WebAssembly APIs
Compilation and Instantiation
JS
Promise<ResultObject> WebAssembly.instantiateFromFile(path, importObject)Compiles and instantiates WebAssembly code.
Parameters
- string path
The path of the .wasm file within the game package.
- Object importObject [optional]
Supports functions, WebAssembly.Memory, WebAssembly.Table (not yet supported on iOS), and WebAssembly.Global (not yet supported on iOS).
Return Value
- ResultObject
| Property | Value Type | Required | Description |
|---|---|---|---|
| module | WebAssembly.Module | Yes | A compiled WebAssembly.Module object (not yet supported on iOS) |
| instance | WebAssembly.Instance | Yes | A WebAssembly.Instance object containing all exported functions |
