lib: use capital letters in comments
PR-URL: https://github.com/nodejs/node/pull/20567 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
7cc303415c
commit
dc1737881e
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
setupProcessObject();
|
setupProcessObject();
|
||||||
|
|
||||||
// do this good and early, since it handles errors.
|
// Do this good and early, since it handles errors.
|
||||||
setupProcessFatal();
|
setupProcessFatal();
|
||||||
|
|
||||||
setupV8();
|
setupV8();
|
||||||
@ -108,7 +108,7 @@
|
|||||||
});
|
});
|
||||||
process.argv[0] = process.execPath;
|
process.argv[0] = process.execPath;
|
||||||
|
|
||||||
// Handle `--debug*` deprecation and invalidation
|
// Handle `--debug*` deprecation and invalidation.
|
||||||
if (process._invalidDebug) {
|
if (process._invalidDebug) {
|
||||||
process.emitWarning(
|
process.emitWarning(
|
||||||
'`node --debug` and `node --debug-brk` are invalid. ' +
|
'`node --debug` and `node --debug-brk` are invalid. ' +
|
||||||
@ -177,7 +177,7 @@
|
|||||||
'DeprecationWarning', 'DEP0068');
|
'DeprecationWarning', 'DEP0068');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the debugger agent
|
// Start the debugger agent.
|
||||||
process.nextTick(function() {
|
process.nextTick(function() {
|
||||||
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
|
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
|
||||||
});
|
});
|
||||||
@ -186,7 +186,7 @@
|
|||||||
NativeModule.require('internal/v8_prof_processor');
|
NativeModule.require('internal/v8_prof_processor');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// There is user code to be run
|
// There is user code to be run.
|
||||||
|
|
||||||
// If this is a worker in cluster mode, start up the communication
|
// If this is a worker in cluster mode, start up the communication
|
||||||
// channel. This needs to be done before any user code gets executed
|
// channel. This needs to be done before any user code gets executed
|
||||||
@ -204,7 +204,7 @@
|
|||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
|
||||||
// User passed '-e' or '--eval' arguments to Node without '-i' or
|
// User passed '-e' or '--eval' arguments to Node without '-i' or
|
||||||
// '--interactive'
|
// '--interactive'.
|
||||||
|
|
||||||
perf.markMilestone(
|
perf.markMilestone(
|
||||||
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
|
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
|
||||||
@ -218,7 +218,7 @@
|
|||||||
evalScript('[eval]');
|
evalScript('[eval]');
|
||||||
} else if (process.argv[1] && process.argv[1] !== '-') {
|
} else if (process.argv[1] && process.argv[1] !== '-') {
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
||||||
// make process.argv[1] into a full path
|
// Make process.argv[1] into a full path.
|
||||||
const path = NativeModule.require('path');
|
const path = NativeModule.require('path');
|
||||||
process.argv[1] = path.resolve(process.argv[1]);
|
process.argv[1] = path.resolve(process.argv[1]);
|
||||||
|
|
||||||
@ -230,10 +230,10 @@
|
|||||||
preloadModules();
|
preloadModules();
|
||||||
perf.markMilestone(
|
perf.markMilestone(
|
||||||
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
|
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
|
||||||
// check if user passed `-c` or `--check` arguments to Node.
|
// Check if user passed `-c` or `--check` arguments to Node.
|
||||||
if (process._syntax_check_only != null) {
|
if (process._syntax_check_only != null) {
|
||||||
const fs = NativeModule.require('fs');
|
const fs = NativeModule.require('fs');
|
||||||
// read the source
|
// Read the source.
|
||||||
const filename = CJSModule._resolveFilename(process.argv[1]);
|
const filename = CJSModule._resolveFilename(process.argv[1]);
|
||||||
const source = fs.readFileSync(filename, 'utf-8');
|
const source = fs.readFileSync(filename, 'utf-8');
|
||||||
checkScriptSyntax(source, filename);
|
checkScriptSyntax(source, filename);
|
||||||
@ -365,7 +365,7 @@
|
|||||||
function setupGlobalConsole() {
|
function setupGlobalConsole() {
|
||||||
const originalConsole = global.console;
|
const originalConsole = global.console;
|
||||||
const CJSModule = NativeModule.require('internal/modules/cjs/loader');
|
const CJSModule = NativeModule.require('internal/modules/cjs/loader');
|
||||||
// Setup Node.js global.console
|
// Setup Node.js global.console.
|
||||||
const wrappedConsole = NativeModule.require('console');
|
const wrappedConsole = NativeModule.require('console');
|
||||||
Object.defineProperty(global, 'console', {
|
Object.defineProperty(global, 'console', {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
@ -399,7 +399,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { addCommandLineAPI, consoleCall } = process.binding('inspector');
|
const { addCommandLineAPI, consoleCall } = process.binding('inspector');
|
||||||
// Setup inspector command line API
|
// Setup inspector command line API.
|
||||||
const { makeRequireFunction } =
|
const { makeRequireFunction } =
|
||||||
NativeModule.require('internal/modules/cjs/helpers');
|
NativeModule.require('internal/modules/cjs/helpers');
|
||||||
const path = NativeModule.require('path');
|
const path = NativeModule.require('path');
|
||||||
@ -449,14 +449,14 @@
|
|||||||
exceptionHandlerState.captureFn(er);
|
exceptionHandlerState.captureFn(er);
|
||||||
} else if (!process.emit('uncaughtException', er)) {
|
} else if (!process.emit('uncaughtException', er)) {
|
||||||
// If someone handled it, then great. otherwise, die in C++ land
|
// If someone handled it, then great. otherwise, die in C++ land
|
||||||
// since that means that we'll exit the process, emit the 'exit' event
|
// since that means that we'll exit the process, emit the 'exit' event.
|
||||||
try {
|
try {
|
||||||
if (!process._exiting) {
|
if (!process._exiting) {
|
||||||
process._exiting = true;
|
process._exiting = true;
|
||||||
process.emit('exit', 1);
|
process.emit('exit', 1);
|
||||||
}
|
}
|
||||||
} catch (er) {
|
} catch {
|
||||||
// nothing to be done about it at this point.
|
// Nothing to be done about it at this point.
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { kExpandStackSymbol } = NativeModule.require('internal/util');
|
const { kExpandStackSymbol } = NativeModule.require('internal/util');
|
||||||
@ -467,7 +467,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we handled an error, then make sure any ticks get processed
|
// If we handled an error, then make sure any ticks get processed
|
||||||
// by ensuring that the next Immediate cycle isn't empty
|
// by ensuring that the next Immediate cycle isn't empty.
|
||||||
NativeModule.require('timers').setImmediate(noop);
|
NativeModule.require('timers').setImmediate(noop);
|
||||||
|
|
||||||
// Emit the after() hooks now that the exception has been handled.
|
// Emit the after() hooks now that the exception has been handled.
|
||||||
@ -560,7 +560,7 @@
|
|||||||
process._tickCallback();
|
process._tickCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load preload modules
|
// Load preload modules.
|
||||||
function preloadModules() {
|
function preloadModules() {
|
||||||
if (process._preload_modules) {
|
if (process._preload_modules) {
|
||||||
const {
|
const {
|
||||||
@ -577,13 +577,13 @@
|
|||||||
stripShebang, stripBOM
|
stripShebang, stripBOM
|
||||||
} = NativeModule.require('internal/modules/cjs/helpers');
|
} = NativeModule.require('internal/modules/cjs/helpers');
|
||||||
|
|
||||||
// remove Shebang
|
// Remove Shebang.
|
||||||
source = stripShebang(source);
|
source = stripShebang(source);
|
||||||
// remove BOM
|
// Remove BOM.
|
||||||
source = stripBOM(source);
|
source = stripBOM(source);
|
||||||
// wrap it
|
// Wrap it.
|
||||||
source = CJSModule.wrap(source);
|
source = CJSModule.wrap(source);
|
||||||
// compile the script, this will throw if it fails
|
// Compile the script, this will throw if it fails.
|
||||||
new vm.Script(source, { displayErrors: true, filename });
|
new vm.Script(source, { displayErrors: true, filename });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user