Class: WASMJSAPI

WASMJSAPI(wasmInstance, helperFunctions)

WASMJSAPI class. Creates a JS API from a WASM instance by demangling C++ function names.

Constructor

new WASMJSAPI(wasmInstance, helperFunctions)

WASMJSAPI constructor.
Parameters:
Name Type Description
wasmInstance Object An instantiated WASM.
helperFunctions Object An object that provides these helper functions: malloc, free, memset, demangle.
Source:

Methods

allocString(str) → {Number}

Converts a JS string to a WASM string.
Parameters:
Name Type Description
str String The JS string.
Source:
Returns:
A pointer to the WASM string.
Type
Number

freeString(ptr)

Frees the memory of the WASM string.
Parameters:
Name Type Description
ptr Number The pointer to the WASM string.
Source: