File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -206,13 +206,6 @@ if (!config.noBrowserGlobals) {
206206 defineOperation ( global , 'setImmediate' , timers . setImmediate ) ;
207207}
208208
209- Object . defineProperty ( process , 'argv0' , {
210- enumerable : true ,
211- configurable : false ,
212- value : process . argv [ 0 ]
213- } ) ;
214- process . argv [ 0 ] = process . execPath ;
215-
216209// TODO(jasnell): The following have been globals since around 2012.
217210// That's just silly. The underlying perfctr support has been removed
218211// so these are now deprecated non-ops that can be removed after one
Original file line number Diff line number Diff line change 33const { getOptionValue } = require ( 'internal/options' ) ;
44
55function prepareMainThreadExecution ( ) {
6+ // Patch the process object with legacy properties and normalizations
7+ patchProcessObject ( ) ;
68 setupTraceCategoryState ( ) ;
79
810 setupWarningHandler ( ) ;
@@ -59,6 +61,15 @@ function prepareMainThreadExecution() {
5961 loadPreloadModules ( ) ;
6062}
6163
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+
6273function setupWarningHandler ( ) {
6374 const {
6475 onWarning
@@ -307,6 +318,7 @@ function loadPreloadModules() {
307318}
308319
309320module . exports = {
321+ patchProcessObject,
310322 setupCoverageHooks,
311323 setupWarningHandler,
312324 setupDebugEnv,
Original file line number Diff line number Diff line change 44// message port.
55
66const {
7+ patchProcessObject,
78 setupCoverageHooks,
89 setupWarningHandler,
910 setupDebugEnv,
@@ -41,6 +42,7 @@ const {
4142
4243const publicWorker = require ( 'worker_threads' ) ;
4344
45+ patchProcessObject ( ) ;
4446setupDebugEnv ( ) ;
4547
4648const debug = require ( 'util' ) . debuglog ( 'worker' ) ;
You can’t perform that action at this time.
0 commit comments