@@ -1446,7 +1446,7 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
14461446 if 'MODULARIZE' in user_settings :
14471447 exit_with_error ('EXPORT_ES6 requires MODULARIZE to be set' )
14481448 settings .MODULARIZE = 1
1449- if shared . target_environment_may_be ( 'node' ) and not settings .USE_ES6_IMPORT_META :
1449+ if settings . ENVIRONMENT_MAY_BE_NODE and not settings .USE_ES6_IMPORT_META :
14501450 # EXPORT_ES6 + ENVIRONMENT=*node* requires the use of import.meta.url
14511451 if 'USE_ES6_IMPORT_META' in user_settings :
14521452 exit_with_error ('EXPORT_ES6 and ENVIRONMENT=*node* requires USE_ES6_IMPORT_META to be set' )
@@ -1773,7 +1773,7 @@ def get_full_import_name(name):
17731773 if settings .NODE_CODE_CACHING :
17741774 if settings .WASM_ASYNC_COMPILATION :
17751775 exit_with_error ('NODE_CODE_CACHING requires sync compilation (WASM_ASYNC_COMPILATION=0)' )
1776- if not shared . target_environment_may_be ( 'node' ) :
1776+ if not settings . ENVIRONMENT_MAY_BE_NODE :
17771777 exit_with_error ('NODE_CODE_CACHING only works in node, but target environments do not include it' )
17781778 if settings .SINGLE_FILE :
17791779 exit_with_error ('NODE_CODE_CACHING saves a file on the side and is not compatible with SINGLE_FILE' )
@@ -2372,11 +2372,11 @@ def phase_binaryen(target, options, wasm_target):
23722372
23732373
23742374def node_es6_imports ():
2375- if not settings .EXPORT_ES6 or not shared . target_environment_may_be ( 'node' ) :
2375+ if not settings .EXPORT_ES6 or not settings . ENVIRONMENT_MAY_BE_NODE :
23762376 return ''
23772377
23782378 # Multi-environment builds uses `await import` in `shell.js`
2379- if shared . target_environment_may_be ( 'web' ) :
2379+ if settings . ENVIRONMENT_MAY_BE_WEB :
23802380 return ''
23812381
23822382 # Use static import declaration if we only target Node.js
@@ -2403,8 +2403,8 @@ def modularize():
24032403 # Multi-environment ES6 builds require an async function
24042404 async_emit = ''
24052405 if settings .EXPORT_ES6 and \
2406- shared . target_environment_may_be ( 'node' ) and \
2407- shared . target_environment_may_be ( 'web' ) :
2406+ settings . ENVIRONMENT_MAY_BE_NODE and \
2407+ settings . ENVIRONMENT_MAY_BE_WEB :
24082408 async_emit = 'async '
24092409
24102410 # TODO: Remove when https://bugs.webkit.org/show_bug.cgi?id=223533 is resolved.
@@ -2452,7 +2452,7 @@ def modularize():
24522452 script_url = 'import.meta.url'
24532453 else :
24542454 script_url = "typeof document != 'undefined' ? document.currentScript?.src : undefined"
2455- if shared . target_environment_may_be ( 'node' ) :
2455+ if settings . ENVIRONMENT_MAY_BE_NODE :
24562456 script_url_node = "if (typeof __filename != 'undefined') _scriptName = _scriptName || __filename;"
24572457 if settings .MODULARIZE == 'instance' :
24582458 src = '''%(node_imports)s
0 commit comments