Skip to content

Commit

Permalink
lib: changed var to const in bootstrap_node.js
Browse files Browse the repository at this point in the history
PR-URL: #8588
Reviewed-By: Yosuke Furukawa <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Teddy Katz <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
AdriVanHoudt authored and Fishrock123 committed Oct 11, 2016
1 parent 3ddf77f commit 858a7bb
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(function(process) {

function startup() {
var EventEmitter = NativeModule.require('events');
const EventEmitter = NativeModule.require('events');
process._eventsCount = 0;

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

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

var Module = NativeModule.require('module');
const Module = NativeModule.require('module');

// check if user passed `-c` or `--check` arguments to Node.
if (process._syntax_check_only != null) {
var vm = NativeModule.require('vm');
var fs = NativeModule.require('fs');
var internalModule = NativeModule.require('internal/module');
const vm = NativeModule.require('vm');
const fs = NativeModule.require('fs');
const internalModule = NativeModule.require('internal/module');
// read the source
var filename = Module._resolveFilename(process.argv[1]);
const filename = Module._resolveFilename(process.argv[1]);
var source = fs.readFileSync(filename, 'utf-8');
// remove shebang and BOM
source = internalModule.stripBOM(source.replace(/^\#\!.*/, ''));
Expand All @@ -152,7 +152,7 @@
// If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL
var cliRepl = NativeModule.require('internal/repl');
const cliRepl = NativeModule.require('internal/repl');
cliRepl.createInternalRepl(process.env, function(err, repl) {
if (err) {
throw err;
Expand Down Expand Up @@ -266,7 +266,7 @@
wrapConsoleCall) {
if (!inspectorConsole)
return;
var config = {};
const config = {};
for (const key of Object.keys(console)) {
if (!inspectorConsole.hasOwnProperty(key))
continue;
Expand Down Expand Up @@ -386,7 +386,7 @@
// V8 debug object about a connection, and runMain when
// that occurs. --isaacs

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

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

var ContextifyScript = process.binding('contextify').ContextifyScript;
const ContextifyScript = process.binding('contextify').ContextifyScript;
function runInThisContext(code, options) {
var script = new ContextifyScript(code, options);
const script = new ContextifyScript(code, options);
return script.runInThisContext();
}

Expand All @@ -421,7 +421,7 @@
return NativeModule;
}

var cached = NativeModule.getCached(id);
const cached = NativeModule.getCached(id);
if (cached && (cached.loaded || cached.loading)) {
return cached.exports;
}
Expand All @@ -432,7 +432,7 @@

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

var nativeModule = new NativeModule(id);
const nativeModule = new NativeModule(id);

nativeModule.cache();
nativeModule.compile();
Expand Down Expand Up @@ -489,7 +489,7 @@
this.loading = true;

try {
var fn = runInThisContext(source, {
const fn = runInThisContext(source, {
filename: this.filename,
lineOffset: 0,
displayErrors: true
Expand Down

0 comments on commit 858a7bb

Please sign in to comment.