Skip to content

Commit

Permalink
[JSPI] - Assert that JSPI is supported by the environment. (emscripte…
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandahl authored Mar 7, 2024
1 parent d9a8f7f commit cf81dbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/library_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ addToLibrary({
instrumentWasmImports(imports) {
#if ASYNCIFY_DEBUG
dbg('asyncify instrumenting imports');
#endif
#if ASSERTIONS && ASYNCIFY == 2
assert('Suspender' in WebAssembly, 'JSPI not supported by current environment. Perhaps it needs to be enabled via flags?');
#endif
var importPattern = {{{ new RegExp(`^(${ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS.map(x => x.split('.')[1]).join('|').replace(/\*/g, '.*')})$`) }}};

Expand Down

0 comments on commit cf81dbe

Please sign in to comment.