Skip to content

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
PropertyValue TypeRequiredDescription
moduleWebAssembly.ModuleYesA compiled WebAssembly.Module object (not yet supported on iOS)
instanceWebAssembly.InstanceYesA WebAssembly.Instance object containing all exported functions