Skip to content

Commit

Permalink
process: changed var to const in internal/process.js
Browse files Browse the repository at this point in the history
PR-URL: #8614
Refs: nodejs/code-and-learn#56
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
  • Loading branch information
AdriVanHoudt authored and Fishrock123 committed Oct 11, 2016
1 parent 7875589 commit e0c10f6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/internal/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function setupKillAndExit() {
}

if (err) {
var errnoException = require('util')._errnoException;
const errnoException = require('util')._errnoException;
throw errnoException(err, 'kill');
}

Expand All @@ -180,7 +180,7 @@ function setupKillAndExit() {
function setupSignalHandlers() {
// Load events module in order to access prototype elements on process like
// process.addListener.
var signalWraps = {};
const signalWraps = {};

function isSignal(event) {
return typeof event === 'string' &&
Expand All @@ -191,18 +191,18 @@ function setupSignalHandlers() {
process.on('newListener', function(type, listener) {
if (isSignal(type) &&
!signalWraps.hasOwnProperty(type)) {
var Signal = process.binding('signal_wrap').Signal;
var wrap = new Signal();
const Signal = process.binding('signal_wrap').Signal;
const wrap = new Signal();

wrap.unref();

wrap.onsignal = function() { process.emit(type); };

var signum = lazyConstants()[type];
var err = wrap.start(signum);
const signum = lazyConstants()[type];
const err = wrap.start(signum);
if (err) {
wrap.close();
var errnoException = require('util')._errnoException;
const errnoException = require('util')._errnoException;
throw errnoException(err, 'uv_signal_start');
}

Expand All @@ -223,13 +223,13 @@ function setupChannel() {
// If we were spawned with env NODE_CHANNEL_FD then load that up and
// start parsing data from that stream.
if (process.env.NODE_CHANNEL_FD) {
var fd = parseInt(process.env.NODE_CHANNEL_FD, 10);
const fd = parseInt(process.env.NODE_CHANNEL_FD, 10);
assert(fd >= 0);

// Make sure it's not accidentally inherited by child processes.
delete process.env.NODE_CHANNEL_FD;

var cp = require('child_process');
const cp = require('child_process');

// Load tcp_wrap to avoid situation where we might immediately receive
// a message.
Expand All @@ -243,8 +243,8 @@ function setupChannel() {


function setupRawDebug() {
var format = require('util').format;
var rawDebug = process._rawDebug;
const format = require('util').format;
const rawDebug = process._rawDebug;
process._rawDebug = function() {
rawDebug(format.apply(null, arguments));
};
Expand Down

0 comments on commit e0c10f6

Please sign in to comment.