Skip to content

Commit cf81dbe

Browse files
authored
[JSPI] - Assert that JSPI is supported by the environment. (emscripten-core#21483)
1 parent d9a8f7f commit cf81dbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/library_async.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ addToLibrary({
4040
instrumentWasmImports(imports) {
4141
#if ASYNCIFY_DEBUG
4242
dbg('asyncify instrumenting imports');
43+
#endif
44+
#if ASSERTIONS && ASYNCIFY == 2
45+
assert('Suspender' in WebAssembly, 'JSPI not supported by current environment. Perhaps it needs to be enabled via flags?');
4346
#endif
4447
var importPattern = {{{ new RegExp(`^(${ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS.map(x => x.split('.')[1]).join('|').replace(/\*/g, '.*')})$`) }}};
4548

0 commit comments

Comments
 (0)