@@ -165,14 +165,16 @@ def setup_environment_settings():
165165 # The worker environment is automatically added if any of the pthread or Worker features are used.
166166 # Note: we need to actually modify ENVIRONMENTS variable here before the parsing,
167167 # because some JS code reads it back so modifying parsed info alone is not sufficient.
168+ maybe_web_worker = not settings .ENVIRONMENT or 'worker' in settings .ENVIRONMENT
169+
168170 if settings .SHARED_MEMORY and settings .ENVIRONMENT :
169171 settings .ENVIRONMENT .append ('worker' )
170172
171173 # Environment setting based on user input
172174 if any (x for x in settings .ENVIRONMENT if x not in VALID_ENVIRONMENTS ):
173175 exit_with_error (f'Invalid environment specified in "ENVIRONMENT": { settings .ENVIRONMENT } . Should be one of: { "," .join (VALID_ENVIRONMENTS )} ' )
174176
175- settings .ENVIRONMENT_MAY_BE_WEB = not settings .ENVIRONMENT or 'web' in settings .ENVIRONMENT or 'worker' in settings . ENVIRONMENT
177+ settings .ENVIRONMENT_MAY_BE_WEB = not settings .ENVIRONMENT or 'web' in settings .ENVIRONMENT
176178 settings .ENVIRONMENT_MAY_BE_WEBVIEW = not settings .ENVIRONMENT or 'webview' in settings .ENVIRONMENT
177179 settings .ENVIRONMENT_MAY_BE_NODE = not settings .ENVIRONMENT or 'node' in settings .ENVIRONMENT
178180 settings .ENVIRONMENT_MAY_BE_SHELL = not settings .ENVIRONMENT or 'shell' in settings .ENVIRONMENT
@@ -183,11 +185,11 @@ def setup_environment_settings():
183185 diagnostics .warning ('unused-command-line-argument' , 'ignoring MIN_NODE_VERSION because `node` environment is not enabled' )
184186 settings .MIN_NODE_VERSION = feature_matrix .UNSUPPORTED
185187
186- if not (settings .ENVIRONMENT_MAY_BE_WEB or settings .ENVIRONMENT_MAY_BE_WEBVIEW ):
188+ if not (settings .ENVIRONMENT_MAY_BE_WEB or maybe_web_worker or settings .ENVIRONMENT_MAY_BE_WEBVIEW ):
187189 for browser in ('FIREFOX' , 'SAFARI' , 'CHROME' ):
188190 key = f'MIN_{ browser } _VERSION'
189191 if key in user_settings and settings [key ] != feature_matrix .UNSUPPORTED :
190- diagnostics .warning ('unused-command-line-argument' , 'ignoring %s because `web` and `webview` environments are not enabled' , key )
192+ diagnostics .warning ('unused-command-line-argument' , 'ignoring %s because `web`, `worker` and `webview` environments are not enabled' , key )
191193 settings [key ] = feature_matrix .UNSUPPORTED
192194
193195
0 commit comments