Skip to content

Commit

Permalink
Fix -sMODULARIZE + -sLEGACY_VM_SUPPORT
Browse files Browse the repository at this point in the history
When we run babel in `-sMODULARIZE` mode the input to babel contains
`await` calls.  This code appears to be top-level code at the point
at which we run babel since we have yet to perform the modularization
process which wraps the output in a factory function.

Fixes: emscripten-core#23687
  • Loading branch information
sbc100 committed Feb 18, 2025
1 parent 582267f commit 6a79599
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -7056,6 +7056,9 @@ class Descriptor {
self.run_process([EMXX, 'src.cpp', '-O2', '-sEXPORT_ALL'])
self.assertExists('a.out.js')

def test_modularize_legacy(self):
self.do_runf('hello_world.c', emcc_args=['-sMODULARIZE', '-sLEGACY_VM_SUPPORT'])

def test_emmake_emconfigure(self):
def check(what, args, fail=True, expect=''):
args = [what] + args
Expand Down
2 changes: 1 addition & 1 deletion tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def version_split(v):
@ToolchainProfiler.profile()
def transpile(filename):
config = {
'sourceType': 'script',
'sourceType': 'module',
'targets': {}
}
if settings.MIN_CHROME_VERSION != UNSUPPORTED:
Expand Down

0 comments on commit 6a79599

Please sign in to comment.