Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: changed var to const in internal/process.js #8614

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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