@@ -166,7 +166,7 @@ def will_metadce():
166166def setup_environment_settings ():
167167 # Environment setting based on user input
168168 environments = settings .ENVIRONMENT .split (',' )
169- if any ([ x for x in environments if x not in VALID_ENVIRONMENTS ] ):
169+ if any (x for x in environments if x not in VALID_ENVIRONMENTS ):
170170 exit_with_error (f'Invalid environment specified in "ENVIRONMENT": { settings .ENVIRONMENT } . Should be one of: { "," .join (VALID_ENVIRONMENTS )} ' )
171171
172172 settings .ENVIRONMENT_MAY_BE_WEB = not settings .ENVIRONMENT or 'web' in environments
@@ -216,8 +216,8 @@ def get_js_sym_info():
216216 # and can contain full paths to temporary files.
217217 skip_settings = {'PRE_JS_FILES' , 'POST_JS_FILES' }
218218 input_files = [json .dumps (settings .external_dict (skip_keys = skip_settings ), sort_keys = True , indent = 2 )]
219- for jslib in sorted ( glob .glob (utils .path_from_root ('src' ) + '/library*.js' )):
220- input_files .append (read_file (jslib ))
219+ jslibs = glob .glob (utils .path_from_root ('src' ) + '/library*.js' )
220+ input_files .extend (read_file (jslib ) for jslib in sorted ( jslibs ))
221221 for jslib in settings .JS_LIBRARIES :
222222 if not os .path .isabs (jslib ):
223223 jslib = utils .path_from_root ('src' , jslib )
@@ -628,7 +628,7 @@ def check_browser_versions():
628628
629629 if settings .LEGACY_VM_SUPPORT :
630630 # Default all browser versions to zero
631- for key in min_version_settings . keys () :
631+ for key in min_version_settings :
632632 default_setting (key , 0 )
633633
634634 for key , oldest in min_version_settings .items ():
@@ -970,9 +970,8 @@ def phase_linker_setup(options, state, newargs):
970970 if settings .MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and settings .MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION :
971971 exit_with_error ('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION are mutually exclusive!' )
972972
973- if options .emrun :
974- if settings .MINIMAL_RUNTIME :
975- exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
973+ if options .emrun and settings .MINIMAL_RUNTIME :
974+ exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
976975
977976 if options .use_closure_compiler :
978977 settings .USE_CLOSURE_COMPILER = 1
@@ -2945,7 +2944,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29452944 dylibs += extras
29462945 for dylib in dylibs :
29472946 exports = webassembly .get_exports (dylib )
2948- exports = set ( e .name for e in exports )
2947+ exports = { e .name for e in exports }
29492948 # EM_JS function are exports with a special prefix. We need to strip
29502949 # this prefix to get the actual symbol name. For the main module, this
29512950 # is handled by extract_metadata.py.
@@ -2959,7 +2958,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29592958 # TODO(sbc): Integrate with metadata.invoke_funcs that comes from the
29602959 # main module to avoid creating new invoke functions at runtime.
29612960 imports = set (imports )
2962- imports = set ( i for i in imports if not i .startswith ('invoke_' ))
2961+ imports = { i for i in imports if not i .startswith ('invoke_' )}
29632962 weak_imports = webassembly .get_weak_imports (dylib )
29642963 strong_imports = sorted (imports .difference (weak_imports ))
29652964 logger .debug ('Adding symbols requirements from `%s`: %s' , dylib , imports )
0 commit comments