mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
process: changed var to const in internal/process.js
PR-URL: https://github.com/nodejs/node/pull/8614 Refs: https://github.com/nodejs/code-and-learn/issues/56 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This commit is contained in:
1 parent
9d4b1f0d84
commit
ce65ac1bd3
1 file changed
+11
-11
+11
-11
@@ -168,7 +168,7 @@ function setupKillAndExit() {
|
||||
}
|
||||
|
||||
if (err) {
|
||||
var errnoException = require('util')._errnoException;
|
||||
const errnoException = require('util')._errnoException;
|
||||
throw errnoException(err, 'kill');
|
||||
}
|
||||
|
||||
@@ -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' &&
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -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));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user