WasmHostFunction typedef

WasmHostFunction = Object? Function(List<Object?> arguments)

A Dart function that WebAssembly imports.

arguments holds the decoded arguments; the return value supplies the results the way JavaScript does it: nothing for a function without results, the value itself for a single result, and a list for several results.

Throwing from the body aborts the WebAssembly call: the exception traps the caller and is then rethrown from the Dart call that started it, which is what JavaScript does with a host function that throws.

Implementation

typedef WasmHostFunction = Object? Function(List<Object?> arguments);