Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/modularize.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
// This code implements the `-sMODULARIZE` settings by taking the generated
// JS program code (INNER_JS_CODE) and wrapping it in a factory function.

#if STRICT_JS
"use strict";
#endif

#if SOURCE_PHASE_IMPORTS
import source wasmModule from './{{{ WASM_BINARY_FILE }}}';
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Copyright 2010 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
#if STRICT_JS
#if STRICT_JS && !MODULARIZE // MODULARIZE handles this itself
"use strict";

#endif

#include "minimum_runtime_check.js"
Expand Down
9 changes: 3 additions & 6 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6306,7 +6306,6 @@ def test_jslib(self):
@with_env_modify({'LC_ALL': 'latin-1', 'PYTHONUTF8': '0', 'PYTHONCOERCECLOCALE': '0'})
@crossplatform
@no_modularize_instance('uses MODULARIZE')
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
def test_unicode_js_library(self):
# First verify that we have correct overridden the default python file encoding.
Expand Down Expand Up @@ -8038,7 +8037,6 @@ def get_wat_addr(call_index):

@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
@no_modularize_instance('uses -sMODULARIZE')
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
def test_modularize_closure_pre(self):
# test that the combination of modularize + closure + pre-js works. in that mode,
# closure should not minify the Module object in a way that the pre-js cannot use it.
Expand Down Expand Up @@ -8985,7 +8983,6 @@ def test_asan_api(self):
self.do_core_test('test_asan_api.c', cflags=['-fsanitize=address'])

@asan
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
@no_modularize_instance('uses MODULARIZE')
def test_asan_modularized_with_closure(self):
Expand Down Expand Up @@ -9680,7 +9677,7 @@ def test_esm_integration(self):
self.assertFileContents(test_file('core/test_esm_integration.expected.mjs'), read_file('hello_world.mjs'))

@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
@no_strict_js('EXPORT_ES6 is not compatible with STRICT_JS')
def test_modularize_instance_hello(self):
self.do_core_test('test_hello_world.c', cflags=['-sMODULARIZE=instance', '-Wno-experimental'])

Expand All @@ -9689,7 +9686,7 @@ def test_modularize_instance_hello(self):
'pthreads': (['-pthread'],),
})
@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
@no_strict_js('EXPORT_ES6 is not compatible with STRICT_JS')
def test_modularize_instance(self, args):
if args:
self.require_pthreads()
Expand Down Expand Up @@ -9725,7 +9722,7 @@ def test_modularize_instance(self, args):

@no_omit_asm_module_exports('MODULARIZE is not compatible with DECLARE_ASM_MODULE_EXPORTS=0')
@no_4gb('EMBIND_AOT can\'t lower 4gb')
@no_strict_js('MODULARIZE is not compatible with STRICT_JS')
@no_strict_js('EXPORT_ES6 is not compatible with STRICT_JS')
def test_modularize_instance_embind(self):
self.run_process([EMXX, test_file('modularize_instance_embind.cpp'),
'-sMODULARIZE=instance',
Expand Down
2 changes: 1 addition & 1 deletion tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ def limit_incoming_module_api():
diagnostics.warning('unused-command-line-argument', '--shell-file ignored when not generating html output')

if settings.STRICT:
if not settings.MODULARIZE:
if not settings.EXPORT_ES6:
default_setting('STRICT_JS', 1)
default_setting('DEFAULT_TO_CXX', 0)
default_setting('IGNORE_MISSING_MAIN', 0)
Expand Down
1 change: 0 additions & 1 deletion tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
('PTHREADS_PROFILING', 'NO_ASSERTIONS', 'only works with ASSERTIONS enabled'),
('SOURCE_PHASE_IMPORTS', 'NO_EXPORT_ES6', None),
('STANDALONE_WASM', 'MINIMAL_RUNTIME', None),
('STRICT_JS', 'MODULARIZE', None),
('STRICT_JS', 'EXPORT_ES6', None),
('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION', 'MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION', 'they are mutually exclusive'),
('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION', 'SINGLE_FILE', None),
Expand Down