Skip to content

Commit e0c10f6

Browse files
AdriVanHoudtFishrock123
authored andcommitted
process: changed var to const in internal/process.js
PR-URL: #8614 Refs: nodejs/code-and-learn#56 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ilkka Myller <[email protected]>
1 parent 7875589 commit e0c10f6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/internal/process.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function setupKillAndExit() {
168168
}
169169

170170
if (err) {
171-
var errnoException = require('util')._errnoException;
171+
const errnoException = require('util')._errnoException;
172172
throw errnoException(err, 'kill');
173173
}
174174

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

185185
function isSignal(event) {
186186
return typeof event === 'string' &&
@@ -191,18 +191,18 @@ function setupSignalHandlers() {
191191
process.on('newListener', function(type, listener) {
192192
if (isSignal(type) &&
193193
!signalWraps.hasOwnProperty(type)) {
194-
var Signal = process.binding('signal_wrap').Signal;
195-
var wrap = new Signal();
194+
const Signal = process.binding('signal_wrap').Signal;
195+
const wrap = new Signal();
196196

197197
wrap.unref();
198198

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

201-
var signum = lazyConstants()[type];
202-
var err = wrap.start(signum);
201+
const signum = lazyConstants()[type];
202+
const err = wrap.start(signum);
203203
if (err) {
204204
wrap.close();
205-
var errnoException = require('util')._errnoException;
205+
const errnoException = require('util')._errnoException;
206206
throw errnoException(err, 'uv_signal_start');
207207
}
208208

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

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

232-
var cp = require('child_process');
232+
const cp = require('child_process');
233233

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

244244

245245
function setupRawDebug() {
246-
var format = require('util').format;
247-
var rawDebug = process._rawDebug;
246+
const format = require('util').format;
247+
const rawDebug = process._rawDebug;
248248
process._rawDebug = function() {
249249
rawDebug(format.apply(null, arguments));
250250
};

0 commit comments

Comments
 (0)