@@ -3485,24 +3485,6 @@ def test_jspi_async_function(self):
34853485 '-Wno-experimental',
34863486 '--post-js=post.js'])
34873487
3488- @requires_jspi
3489- def test_jspi_bad_library_function(self):
3490- create_file('lib.js', r'''
3491- addToLibrary({
3492- foo__async: true,
3493- foo: function(f) {},
3494- });
3495- ''')
3496- create_file('main.c', r'''
3497- #include <emscripten.h>
3498- extern void foo();
3499- EMSCRIPTEN_KEEPALIVE void test() {
3500- foo();
3501- }
3502- ''')
3503- err = self.expect_fail([EMCC, 'main.c', '-o', 'out.js', '-sJSPI', '--js-library=lib.js', '-Wno-experimental'])
3504- self.assertContained('error: \'foo\' is marked with the __async decorator but is not an async JS function.', err)
3505-
35063488 @requires_dev_dependency('typescript')
35073489 @parameterized({
35083490 'commonjs': [['-sMODULARIZE'], ['--module', 'commonjs', '--moduleResolution', 'node']],
@@ -5031,6 +5013,24 @@ def test_jslib_system_lib_name(self):
50315013''')
50325014 self.do_runf('src.c', 'jslibfunc: 12', cflags=['--js-library', 'libcore.js'])
50335015
5016+ @requires_jspi
5017+ def test_jslib_jspi_missing_async(self):
5018+ create_file('lib.js', r'''
5019+ addToLibrary({
5020+ foo__async: true,
5021+ foo: function(f) {},
5022+ });
5023+ ''')
5024+ create_file('main.c', r'''
5025+ #include <emscripten.h>
5026+ extern void foo();
5027+ EMSCRIPTEN_KEEPALIVE void test() {
5028+ foo();
5029+ }
5030+ ''')
5031+ err = self.expect_fail([EMCC, 'main.c', '-o', 'out.js', '-sJSPI', '--js-library=lib.js', '-Wno-experimental'])
5032+ self.assertContained('error: \'foo\' is marked with the __async decorator but is not an async JS function.', err)
5033+
50345034 def test_EMCC_BUILD_DIR(self):
50355035 # EMCC_BUILD_DIR was necessary in the past since we used to force the cwd to be src/ for
50365036 # technical reasons.
0 commit comments