Skip to content

Commit 82af91b

Browse files
authored
Allow closure compiler with NO_DYNAMIC_EXECUTION (emscripten-core#9845)
This has been ok since we made closure no longer depend on eval(), but we forgot to remove the error.
1 parent 59094cf commit 82af91b

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

emcc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,6 @@ def check(input_file):
11251125
if shared.Settings.EMTERPRETIFY_FILE and shared.Settings.SINGLE_FILE:
11261126
exit_with_error('cannot have both EMTERPRETIFY_FILE and SINGLE_FILE enabled at the same time')
11271127

1128-
if options.use_closure_compiler and not shared.Settings.DYNAMIC_EXECUTION:
1129-
exit_with_error('cannot have both NO_DYNAMIC_EXECUTION and closure compiler enabled at the same time')
1130-
11311128
if options.emrun:
11321129
if shared.Settings.MINIMAL_RUNTIME:
11331130
exit_with_error('--emrun is not compatible with -s MINIMAL_RUNTIME=1')

tests/test_core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,9 @@ def test_runtime_stacksave(self):
19141914
def test_memorygrowth(self):
19151915
if self.has_changed_setting('ALLOW_MEMORY_GROWTH'):
19161916
self.skipTest('test needs to modify memory growth')
1917-
self.maybe_closure()
1917+
if self.maybe_closure():
1918+
# verify NO_DYNAMIC_EXECUTION is compatible with closure
1919+
self.set_setting('DYNAMIC_EXECUTION', 0)
19181920
# With typed arrays in particular, it is dangerous to use more memory than TOTAL_MEMORY,
19191921
# since we then need to enlarge the heap(s).
19201922
src = open(path_from_root('tests', 'core', 'test_memorygrowth.c')).read()

tests/test_other.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4112,11 +4112,6 @@ def test_no_dynamic_execution(self):
41124112
assert 'new Function' not in src
41134113
try_delete('a.out.js')
41144114

4115-
# Test that -s DYNAMIC_EXECUTION=0 and --closure 1 are not allowed together.
4116-
self.expect_fail([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-O1',
4117-
'-s', 'DYNAMIC_EXECUTION=0', '--closure', '1'])
4118-
try_delete('a.out.js')
4119-
41204115
# Test that -s DYNAMIC_EXECUTION=1 and -s RELOCATABLE=1 are not allowed together.
41214116
self.expect_fail([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-O1',
41224117
'-s', 'DYNAMIC_EXECUTION=0', '-s', 'RELOCATABLE=1'])

0 commit comments

Comments
 (0)