@@ -3497,24 +3497,6 @@ def test_jspi_async_function(self):
34973497 '-Wno-experimental',
34983498 '--post-js=post.js'])
34993499
3500- @requires_jspi
3501- def test_jspi_bad_library_function(self):
3502- create_file('lib.js', r'''
3503- addToLibrary({
3504- foo__async: true,
3505- foo: function(f) {},
3506- });
3507- ''')
3508- create_file('main.c', r'''
3509- #include <emscripten.h>
3510- extern void foo();
3511- EMSCRIPTEN_KEEPALIVE void test() {
3512- foo();
3513- }
3514- ''')
3515- err = self.expect_fail([EMCC, 'main.c', '-o', 'out.js', '-sJSPI', '--js-library=lib.js', '-Wno-experimental'])
3516- self.assertContained('error: \'foo\' is marked with the __async decorator but is not an async JS function.', err)
3517-
35183500 @requires_dev_dependency('typescript')
35193501 @parameterized({
35203502 'commonjs': [['-sMODULARIZE'], ['--module', 'commonjs', '--moduleResolution', 'node']],
@@ -5072,6 +5054,24 @@ def test_jslib_system_lib_name(self):
50725054''')
50735055 self.do_runf('src.c', 'jslibfunc: 12', cflags=['--js-library', 'libcore.js'])
50745056
5057+ @requires_jspi
5058+ def test_jslib_jspi_missing_async(self):
5059+ create_file('lib.js', r'''
5060+ addToLibrary({
5061+ foo__async: true,
5062+ foo: function(f) {},
5063+ });
5064+ ''')
5065+ create_file('main.c', r'''
5066+ #include <emscripten.h>
5067+ extern void foo();
5068+ EMSCRIPTEN_KEEPALIVE void test() {
5069+ foo();
5070+ }
5071+ ''')
5072+ err = self.expect_fail([EMCC, 'main.c', '-o', 'out.js', '-sJSPI', '--js-library=lib.js', '-Wno-experimental'])
5073+ self.assertContained('error: \'foo\' is marked with the __async decorator but is not an async JS function.', err)
5074+
50755075 def test_EMCC_BUILD_DIR(self):
50765076 # EMCC_BUILD_DIR was necessary in the past since we used to force the cwd to be src/ for
50775077 # technical reasons.
0 commit comments