Skip to content

Commit 862812a

Browse files
authored
[esm-integration] Fix syntax error in output at -O2 and above (#24279)
When no exported runtime methods we were generating: export { }; Which acorn (I think) was then just converting to `export`.
1 parent f06e4cd commit 862812a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ jobs:
796796
other.test_native_call_before_init
797797
other.test_node_unhandled_rejection
798798
core2.test_hello_world
799-
core2.test_esm_integration
800-
core0.test_esm_integration
799+
core2.test_esm_integration*
800+
core0.test_esm_integration*
801801
core0.test_pthread_join_and_asyncify
802802
core0.test_async_ccall_promise_jspi*
803803
core0.test_cubescript_jspi"

src/modules.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ function exportRuntimeSymbols() {
523523
const results = exports.filter((name) => name);
524524

525525
if (MODULARIZE == 'instance') {
526+
if (results.length == 0) return '';
526527
return '// Runtime exports\nexport { ' + results.join(', ') + ' };\n';
527528
}
528529

0 commit comments

Comments
 (0)