diff --git a/src/jsifier.mjs b/src/jsifier.mjs index ea7c103942de3..6f17578db8f23 100644 --- a/src/jsifier.mjs +++ b/src/jsifier.mjs @@ -644,7 +644,7 @@ function(${args}) { } if (isStub) { contentText += `\n${mangled}.stub = true;`; - if (ASYNCIFY) { + if (ASYNCIFY && MAIN_MODULE) { contentText += `\nasyncifyStubs['${symbol}'] = undefined;`; } } diff --git a/test/common.py b/test/common.py index 2131e948280bf..19cff333ba051 100644 --- a/test/common.py +++ b/test/common.py @@ -405,7 +405,7 @@ def metafunc(self, with_minimal_runtime, *args, **kwargs): def also_with_wasm_bigint(f): assert callable(f) - def metafunc(self, with_bigint): + def metafunc(self, with_bigint, *args, **kwargs): if with_bigint: if self.is_wasm2js(): self.skipTest('wasm2js does not support WASM_BIGINT') @@ -414,9 +414,9 @@ def metafunc(self, with_bigint): self.set_setting('WASM_BIGINT') nodejs = self.require_node() self.node_args += shared.node_bigint_flags(nodejs) - f(self) + f(self, *args, **kwargs) else: - f(self) + f(self, *args, **kwargs) metafunc._parameterize = {'': (False,), 'bigint': (True,)} @@ -426,14 +426,14 @@ def metafunc(self, with_bigint): def also_with_wasm64(f): assert callable(f) - def metafunc(self, with_wasm64): + def metafunc(self, with_wasm64, *args, **kwargs): if with_wasm64: self.require_wasm64() self.set_setting('MEMORY64') self.emcc_args.append('-Wno-experimental') - f(self) + f(self, *args, **kwargs) else: - f(self) + f(self, *args, **kwargs) metafunc._parameterize = {'': (False,), 'wasm64': (True,)} diff --git a/test/test_other.py b/test/test_other.py index bbfe531c745c4..de243349bca29 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12678,8 +12678,11 @@ def test_check_undefined(self, flag): err = self.expect_fail([EMCC, flag, '-sERROR_ON_UNDEFINED_SYMBOLS', test_file('other/test_check_undefined.c')]) self.assertContained('undefined symbol: foo', err) + @parameterized({ + 'asyncify': (['-sASYNCIFY'],), + }) @also_with_wasm64 - def test_missing_symbols_at_runtime(self): + def test_missing_symbols_at_runtime(self, args): # We deliberately pick a symbol there that takes a pointer as an argument. # We had a regression where the pointer-handling wrapper function could # not be created because the "missing functions" stubs don't take any @@ -12694,7 +12697,7 @@ def test_missing_symbols_at_runtime(self): expected = 'Aborted(missing function: glGetTexLevelParameteriv)' self.do_runf('test.c', expected, - emcc_args=['-sWARN_ON_UNDEFINED_SYMBOLS=0', '-sAUTO_JS_LIBRARIES=0'], + emcc_args=['-sWARN_ON_UNDEFINED_SYMBOLS=0', '-sAUTO_JS_LIBRARIES=0'] + args, assert_returncode=NON_ZERO) @with_env_modify({'EMMAKEN_NO_SDK': '1'})