@@ -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 } { "," .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 )
@@ -622,7 +622,7 @@ def check_browser_versions():
622622
623623  if  settings .LEGACY_VM_SUPPORT :
624624    # Default all browser versions to zero 
625-     for  key  in  min_version_settings . keys () :
625+     for  key  in  min_version_settings :
626626      default_setting (key , 0 )
627627
628628  for  key , oldest  in  min_version_settings .items ():
@@ -964,9 +964,8 @@ def phase_linker_setup(options, state, newargs):
964964  if  settings .MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION  and  settings .MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION :
965965    exit_with_error ('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION are mutually exclusive!' )
966966
967-   if  options .emrun :
968-     if  settings .MINIMAL_RUNTIME :
969-       exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
967+   if  options .emrun  and  settings .MINIMAL_RUNTIME :
968+     exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
970969
971970  if  options .use_closure_compiler :
972971    settings .USE_CLOSURE_COMPILER  =  1 
@@ -2939,7 +2938,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29392938  dylibs  +=  extras 
29402939  for  dylib  in  dylibs :
29412940    exports  =  webassembly .get_exports (dylib )
2942-     exports  =  set ( e .name  for  e  in  exports ) 
2941+     exports  =  { e .name  for  e  in  exports } 
29432942    # EM_JS function are exports with a special prefix.  We need to strip 
29442943    # this prefix to get the actual symbol name.  For the main module, this 
29452944    # is handled by extract_metadata.py. 
@@ -2953,7 +2952,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29532952    # TODO(sbc): Integrate with metadata.invoke_funcs that comes from the 
29542953    # main module to avoid creating new invoke functions at runtime. 
29552954    imports  =  set (imports )
2956-     imports  =  set ( i  for  i  in  imports  if  not  i .startswith ('invoke_' )) 
2955+     imports  =  { i  for  i  in  imports  if  not  i .startswith ('invoke_' )} 
29572956    weak_imports  =  webassembly .get_weak_imports (dylib )
29582957    strong_imports  =  sorted (imports .difference (weak_imports ))
29592958    logger .debug ('Adding symbols requirements from `%s`: %s' , dylib , imports )
0 commit comments