Skip to content

Commit 3d39bf5

Browse files
committed
Apply code review to Emscripten strict mode.
1 parent 8455fba commit 3d39bf5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

emcc.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -925,18 +925,20 @@ def detect_fixed_language_mode(args):
925925
if 'EMCC_STRICT' in os.environ:
926926
shared.Settings.STRICT = os.environ.get('EMCC_STRICT') != '0'
927927

928-
STRICT = ([None] + filter(lambda x: x.startswith('STRICT='), settings_changes))[-1]
929-
if STRICT:
930-
shared.Settings.STRICT = int(STRICT[len('STRICT='):])
928+
# Libraries are searched before settings_changes are applied, so apply the value for STRICT and ERROR_ON_MISSING_LIBRARIES from
929+
# command line already now.
930+
931+
strict_cmdline = (filter(lambda x: x.startswith('STRICT='), settings_changes) or [False])[0]
932+
if strict_cmdline:
933+
shared.Settings.STRICT = int(strict_cmdline[len('STRICT='):])
931934

932935
if shared.Settings.STRICT:
933936
shared.Settings.ERROR_ON_UNDEFINED_SYMBOLS = 1
934937
shared.Settings.ERROR_ON_MISSING_LIBRARIES = 1
935938

936-
# Libraries are searched before settings_changes are applied, so pull its value from the command line already here.
937-
ERROR_ON_MISSING_LIBRARIES = ([None] + filter(lambda x: x.startswith('ERROR_ON_MISSING_LIBRARIES='), settings_changes))[-1]
938-
if ERROR_ON_MISSING_LIBRARIES:
939-
shared.Settings.ERROR_ON_MISSING_LIBRARIES = int(ERROR_ON_MISSING_LIBRARIES[len('ERROR_ON_MISSING_LIBRARIES='):])
939+
error_on_missing_libraries_cmdline = (filter(lambda x: x.startswith('ERROR_ON_MISSING_LIBRARIES='), settings_changes) or [False])[0]
940+
if error_on_missing_libraries_cmdline:
941+
shared.Settings.ERROR_ON_MISSING_LIBRARIES = int(error_on_missing_libraries_cmdline[len('ERROR_ON_MISSING_LIBRARIES='):])
940942

941943
system_js_libraries = []
942944

0 commit comments

Comments
 (0)