@@ -165,14 +165,16 @@ def setup_environment_settings():
165
165
# The worker environment is automatically added if any of the pthread or Worker features are used.
166
166
# Note: we need to actually modify ENVIRONMENTS variable here before the parsing,
167
167
# 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
+
168
170
if settings .SHARED_MEMORY and settings .ENVIRONMENT :
169
171
settings .ENVIRONMENT .append ('worker' )
170
172
171
173
# Environment setting based on user input
172
174
if any (x for x in settings .ENVIRONMENT if x not in VALID_ENVIRONMENTS ):
173
175
exit_with_error (f'Invalid environment specified in "ENVIRONMENT": { settings .ENVIRONMENT } . Should be one of: { "," .join (VALID_ENVIRONMENTS )} ' )
174
176
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
176
178
settings .ENVIRONMENT_MAY_BE_WEBVIEW = not settings .ENVIRONMENT or 'webview' in settings .ENVIRONMENT
177
179
settings .ENVIRONMENT_MAY_BE_NODE = not settings .ENVIRONMENT or 'node' in settings .ENVIRONMENT
178
180
settings .ENVIRONMENT_MAY_BE_SHELL = not settings .ENVIRONMENT or 'shell' in settings .ENVIRONMENT
@@ -183,11 +185,11 @@ def setup_environment_settings():
183
185
diagnostics .warning ('unused-command-line-argument' , 'ignoring MIN_NODE_VERSION because `node` environment is not enabled' )
184
186
settings .MIN_NODE_VERSION = feature_matrix .UNSUPPORTED
185
187
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 ):
187
189
for browser in ('FIREFOX' , 'SAFARI' , 'CHROME' ):
188
190
key = f'MIN_{ browser } _VERSION'
189
191
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 )
191
193
settings [key ] = feature_matrix .UNSUPPORTED
192
194
193
195
0 commit comments