Skip to content

Commit b4d8041

Browse files
committed
Fix -sMODULARIZE + -sLEGACY_VM_SUPPORT
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: #23687
1 parent c50c33d commit b4d8041

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/lib/libglemu.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ var LibraryGLEmulation = {
6161
'/**@suppress {duplicate, undefinedVars}*/var _emscripten_glEnableVertexAttribArray;' +
6262
'/**@suppress {duplicate, undefinedVars}*/var _emscripten_glDisableVertexAttribArray;' +
6363
'/**@suppress {duplicate, undefinedVars}*/var _emscripten_glVertexAttribPointer;' +
64-
'/**@suppress {duplicate, undefinedVars}*/var _glTexEnvf;' +
65-
'/**@suppress {duplicate, undefinedVars}*/var _glTexEnvi;' +
66-
'/**@suppress {duplicate, undefinedVars}*/var _glTexEnvfv;' +
67-
'/**@suppress {duplicate, undefinedVars}*/var _glGetTexEnviv;' +
68-
'/**@suppress {duplicate, undefinedVars}*/var _glGetTexEnvfv;' +
6964
#endif
7065
'GLEmulation.init();',
7166
$GLEmulation: {

test/test_other.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7098,6 +7098,9 @@ class Descriptor {
70987098
self.run_process([EMXX, 'src.cpp', '-O2', '-sEXPORT_ALL'])
70997099
self.assertExists('a.out.js')
71007100

7101+
def test_modularize_legacy(self):
7102+
self.do_runf('hello_world.c', emcc_args=['-sMODULARIZE', '-sLEGACY_VM_SUPPORT'])
7103+
71017104
def test_emmake_emconfigure(self):
71027105
def check(what, args, fail=True, expect=''):
71037106
args = [what] + args

tools/building.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def version_split(v):
511511
@ToolchainProfiler.profile()
512512
def transpile(filename):
513513
config = {
514-
'sourceType': 'script',
514+
'sourceType': 'module',
515515
'targets': {}
516516
}
517517
if settings.MIN_CHROME_VERSION != UNSUPPORTED:

0 commit comments

Comments
 (0)