Skip to content

Commit 858a7bb

Browse files
AdriVanHoudtFishrock123
authored andcommitted
lib: changed var to const in bootstrap_node.js
PR-URL: #8588 Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent 3ddf77f commit 858a7bb

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/internal/bootstrap_node.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(function(process) {
1111

1212
function startup() {
13-
var EventEmitter = NativeModule.require('events');
13+
const EventEmitter = NativeModule.require('events');
1414
process._eventsCount = 0;
1515

1616
Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, {
@@ -104,7 +104,7 @@
104104
// channel. This needs to be done before any user code gets executed
105105
// (including preload modules).
106106
if (process.argv[1] && process.env.NODE_UNIQUE_ID) {
107-
var cluster = NativeModule.require('cluster');
107+
const cluster = NativeModule.require('cluster');
108108
cluster._setupWorker();
109109

110110
// Make sure it's not accidentally inherited by child processes.
@@ -123,18 +123,18 @@
123123
});
124124
} else if (process.argv[1]) {
125125
// make process.argv[1] into a full path
126-
var path = NativeModule.require('path');
126+
const path = NativeModule.require('path');
127127
process.argv[1] = path.resolve(process.argv[1]);
128128

129-
var Module = NativeModule.require('module');
129+
const Module = NativeModule.require('module');
130130

131131
// check if user passed `-c` or `--check` arguments to Node.
132132
if (process._syntax_check_only != null) {
133-
var vm = NativeModule.require('vm');
134-
var fs = NativeModule.require('fs');
135-
var internalModule = NativeModule.require('internal/module');
133+
const vm = NativeModule.require('vm');
134+
const fs = NativeModule.require('fs');
135+
const internalModule = NativeModule.require('internal/module');
136136
// read the source
137-
var filename = Module._resolveFilename(process.argv[1]);
137+
const filename = Module._resolveFilename(process.argv[1]);
138138
var source = fs.readFileSync(filename, 'utf-8');
139139
// remove shebang and BOM
140140
source = internalModule.stripBOM(source.replace(/^\#\!.*/, ''));
@@ -152,7 +152,7 @@
152152
// If -i or --interactive were passed, or stdin is a TTY.
153153
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
154154
// REPL
155-
var cliRepl = NativeModule.require('internal/repl');
155+
const cliRepl = NativeModule.require('internal/repl');
156156
cliRepl.createInternalRepl(process.env, function(err, repl) {
157157
if (err) {
158158
throw err;
@@ -266,7 +266,7 @@
266266
wrapConsoleCall) {
267267
if (!inspectorConsole)
268268
return;
269-
var config = {};
269+
const config = {};
270270
for (const key of Object.keys(console)) {
271271
if (!inspectorConsole.hasOwnProperty(key))
272272
continue;
@@ -386,7 +386,7 @@
386386
// V8 debug object about a connection, and runMain when
387387
// that occurs. --isaacs
388388

389-
var debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50;
389+
const debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50;
390390
setTimeout(entryFunction, debugTimeout);
391391

392392
} else {
@@ -399,9 +399,9 @@
399399
// core modules found in lib/*.js. All core modules are compiled into the
400400
// node binary, so they can be loaded faster.
401401

402-
var ContextifyScript = process.binding('contextify').ContextifyScript;
402+
const ContextifyScript = process.binding('contextify').ContextifyScript;
403403
function runInThisContext(code, options) {
404-
var script = new ContextifyScript(code, options);
404+
const script = new ContextifyScript(code, options);
405405
return script.runInThisContext();
406406
}
407407

@@ -421,7 +421,7 @@
421421
return NativeModule;
422422
}
423423

424-
var cached = NativeModule.getCached(id);
424+
const cached = NativeModule.getCached(id);
425425
if (cached && (cached.loaded || cached.loading)) {
426426
return cached.exports;
427427
}
@@ -432,7 +432,7 @@
432432

433433
process.moduleLoadList.push(`NativeModule ${id}`);
434434

435-
var nativeModule = new NativeModule(id);
435+
const nativeModule = new NativeModule(id);
436436

437437
nativeModule.cache();
438438
nativeModule.compile();
@@ -489,7 +489,7 @@
489489
this.loading = true;
490490

491491
try {
492-
var fn = runInThisContext(source, {
492+
const fn = runInThisContext(source, {
493493
filename: this.filename,
494494
lineOffset: 0,
495495
displayErrors: true

0 commit comments

Comments
 (0)