diff --git a/wasm_patches/post.js b/wasm_patches/post.js index 08138453..275a439f 100644 --- a/wasm_patches/post.js +++ b/wasm_patches/post.js @@ -4,6 +4,15 @@ Module.wasmTable = wasmTable; // Emscripten has a bug where it accidentally exposes an empty object as Module.ERRNO_CODES Module.ERRNO_CODES = ERRNO_CODES; +// these are only defined for emscripten>=4.0.0 +if (typeof getCppExceptionTag !== 'undefined') { + Module['getCppExceptionTag'] = getCppExceptionTag; +} + +if (typeof getExceptionMessage !== 'undefined') { + Module['getExceptionMessage'] = getExceptionMessage; +} + Module['async_init'] = async function( kernel_root_url, pkg_root_url,