File tree 3 files changed +14
-7
lines changed
3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -206,13 +206,6 @@ if (!config.noBrowserGlobals) {
206
206
defineOperation ( global , 'setImmediate' , timers . setImmediate ) ;
207
207
}
208
208
209
- Object . defineProperty ( process , 'argv0' , {
210
- enumerable : true ,
211
- configurable : false ,
212
- value : process . argv [ 0 ]
213
- } ) ;
214
- process . argv [ 0 ] = process . execPath ;
215
-
216
209
// TODO(jasnell): The following have been globals since around 2012.
217
210
// That's just silly. The underlying perfctr support has been removed
218
211
// so these are now deprecated non-ops that can be removed after one
Original file line number Diff line number Diff line change 3
3
const { getOptionValue } = require ( 'internal/options' ) ;
4
4
5
5
function prepareMainThreadExecution ( ) {
6
+ // Patch the process object with legacy properties and normalizations
7
+ patchProcessObject ( ) ;
6
8
setupTraceCategoryState ( ) ;
7
9
8
10
setupWarningHandler ( ) ;
@@ -59,6 +61,15 @@ function prepareMainThreadExecution() {
59
61
loadPreloadModules ( ) ;
60
62
}
61
63
64
+ function patchProcessObject ( ) {
65
+ Object . defineProperty ( process , 'argv0' , {
66
+ enumerable : true ,
67
+ configurable : false ,
68
+ value : process . argv [ 0 ]
69
+ } ) ;
70
+ process . argv [ 0 ] = process . execPath ;
71
+ }
72
+
62
73
function setupWarningHandler ( ) {
63
74
const {
64
75
onWarning
@@ -307,6 +318,7 @@ function loadPreloadModules() {
307
318
}
308
319
309
320
module . exports = {
321
+ patchProcessObject,
310
322
setupCoverageHooks,
311
323
setupWarningHandler,
312
324
setupDebugEnv,
Original file line number Diff line number Diff line change 4
4
// message port.
5
5
6
6
const {
7
+ patchProcessObject,
7
8
setupCoverageHooks,
8
9
setupWarningHandler,
9
10
setupDebugEnv,
@@ -41,6 +42,7 @@ const {
41
42
42
43
const publicWorker = require ( 'worker_threads' ) ;
43
44
45
+ patchProcessObject ( ) ;
44
46
setupDebugEnv ( ) ;
45
47
46
48
const debug = require ( 'util' ) . debuglog ( 'worker' ) ;
You can’t perform that action at this time.
0 commit comments