Lines Matching refs:process
61 // Patch the process object and get the resolved main entry point.
86 require('internal/process/policy')
94 // If the process is spawned with env NODE_CHANNEL_FD, it's probably
97 // process.send(), process.channel, process.connected,
98 // process.disconnect().
164 * Patch the process object with legacy properties and normalizations.
165 * Replace `process.argv[0]` with `process.execPath`, preserving the original `argv[0]` value as `process.argv0`.
166 * Replace `process.argv[1]` with the resolved absolute file path of the entry point, if found.
167 * @param {boolean} expandArgv1 - Whether to replace `process.argv[1]` with the resolved absolute file path of
172 binding.patchProcessObject(process);
174 require('internal/process/per_thread').refreshHrtimeBuffer();
176 // Since we replace process.argv[0] below, preserve the original value in case the user needs it.
177 ObjectDefineProperty(process, 'argv0', {
182 value: process.argv[0],
185 process.exitCode = undefined;
186 process._exiting = false;
187 process.argv[0] = process.execPath;
191 // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
193 if (expandArgv1 && process.argv[1] &&
194 !StringPrototypeStartsWith(process.argv[1], '-')) {
195 // Expand process.argv[1] into a full path.
198 mainEntry = path.resolve(process.argv[1]);
199 process.argv[1] = mainEntry;
205 // We need to initialize the global console here again with process.stdout
222 addReadOnlyProcessAlias('profProcess', '--prof-process');
233 ObjectDefineProperty(process, name, {
247 } = require('internal/process/warning');
249 process.env.NODE_NO_WARNINGS !== '1') {
250 process.on('warning', onWarning);
256 process.removeListener('warning', onWarning);
265 if (process.config.variables.node_no_browser_globals ||
315 if (process.config.variables.node_no_browser_globals ||
333 // overwrite process.env so that the original path gets passed
337 if (process.env.NODE_V8_COVERAGE &&
339 process.env.NODE_V8_COVERAGE =
340 setupCoverageHooks(process.env.NODE_V8_COVERAGE);
347 if (process.config.variables.node_no_browser_globals ||
366 ObjectDefineProperty(process, 'report', {
371 const { report } = require('internal/process/report');
378 require('internal/util/debuglog').initializeDebugEnv(process.env.NODE_DEBUG);
387 const { addSignalHandler } = require('internal/process/report');
404 process.on(signal, doWriteHeapSnapshot);
410 process.removeListener(signal, doWriteHeapSnapshot);
417 const { toggleTraceCategoryState } = require('internal/process/per_thread');
430 // bootstrap, and process the notification later here.
447 // DEP0103: access to `process.binding('util').isX` type checkers
478 // TODO(joyeecheung): this is a legacy property exposed to process.
480 // it from the process. We may consider exposing it properly in
481 // process.features.
484 ObjectDefineProperty(process, '_noBrowserGlobals', {
494 process.binding = deprecate(process.binding,
495 'process.binding() is deprecated. ' +
498 process._tickCallback = deprecate(process._tickCallback,
499 'process._tickCallback() is deprecated',
505 if (process.env.NODE_CHANNEL_FD) {
508 const fd = NumberParseInt(process.env.NODE_CHANNEL_FD, 10);
512 delete process.env.NODE_CHANNEL_FD;
515 process.env.NODE_CHANNEL_SERIALIZATION_MODE || 'json';
516 delete process.env.NODE_CHANNEL_SERIALIZATION_MODE;
519 assert(process.send);
524 if (process.argv[1] && process.env.NODE_UNIQUE_ID) {
528 delete process.env.NODE_UNIQUE_ID;
535 process.emitWarning('Policies are experimental.',
544 const cwdURL = pathToFileURL(process.cwd());
613 process.emitWarning('The --frozen-intrinsics flag is experimental',