@@ -131,8 +131,8 @@ var ENVIRONMENT_IS_WASM_WORKER = !!Module['$ww'];
131
131
// refer to Module (if they choose; they can also define Module)
132
132
{ { { preJS( ) } } }
133
133
134
- var arguments_ = [ ] ;
135
- var thisProgram = './this.program' ;
134
+ { { { makeModuleReceiveWithVar ( ' arguments_' , 'arguments' , undefined , true ) } } }
135
+ { { { makeModuleReceiveWithVar ( ' thisProgram' , undefined , " './this.program'" , true ) } } }
136
136
var quit_ = ( status , toThrow ) => {
137
137
throw toThrow ;
138
138
} ;
@@ -211,7 +211,7 @@ if (ENVIRONMENT_IS_NODE) {
211
211
thisProgram = process . argv [ 1 ] . replace ( / \\ / g, '/' ) ;
212
212
}
213
213
214
- arguments_ = process . argv . slice ( 2 ) ;
214
+ arguments_ ?? = process . argv . slice ( 2 ) ;
215
215
216
216
#if ! MODULARIZE
217
217
// MODULARIZE will export the module in the proper place outside, we don't need to export here
@@ -283,7 +283,7 @@ if (ENVIRONMENT_IS_SHELL) {
283
283
globalThis . setTimeout ??= ( f ) => f ( ) ;
284
284
285
285
// v8 uses `arguments_` whereas spidermonkey uses `scriptArgs`
286
- arguments_ = globalThis . arguments || globalThis . scriptArgs ;
286
+ arguments_ ?? = globalThis . arguments || globalThis . scriptArgs ;
287
287
288
288
if ( typeof quit == 'function' ) {
289
289
quit_ = ( status , toThrow ) = > {
@@ -404,13 +404,6 @@ if (ENVIRONMENT_IS_NODE) {
404
404
checkIncomingModuleAPI ( ) ;
405
405
#endif
406
406
407
- // Emit code to handle expected values on the Module object. This applies Module.x
408
- // to the proper local x. This has two benefits: first, we only emit it if it is
409
- // expected to arrive, and second, by using a local everywhere else that can be
410
- // minified.
411
- { { { makeModuleReceive ( 'arguments_' , 'arguments' ) } } }
412
- { { { makeModuleReceive ( 'thisProgram' ) } } }
413
-
414
407
// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
415
408
#if ASSERTIONS
416
409
// Assertions on removed incoming Module JS APIs.
0 commit comments