From 673e2637f8263632bbe54e9035bdc03c82f05b26 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 26 Nov 2017 12:02:14 -0800 Subject: [PATCH] http2: use more descriptive names PR-URL: https://github.com/nodejs/node/pull/17328 Fixes: https://github.com/nodejs/node/issues/15303 Reviewed-By: Anatoli Papirovski Reviewed-By: Sebastiaan Deckers --- lib/internal/http2/core.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index b56656f694bc78..2e0910dbee2963 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -582,15 +582,15 @@ function doShutdown(options) { function submitShutdown(options) { const type = this[kType]; debug(`Http2Session ${sessionName(type)}: submitting shutdown request`); - const fn = doShutdown.bind(this, options); + const shutdownFn = doShutdown.bind(this, options); if (type === NGHTTP2_SESSION_SERVER && options.graceful === true) { // first send a shutdown notice this[kHandle].shutdownNotice(); // then, on flip of the event loop, do the actual shutdown - setImmediate(fn); + setImmediate(shutdownFn); return; } - fn(); + shutdownFn(); } function finishSessionDestroy(socket) { @@ -877,12 +877,12 @@ class Http2Session extends EventEmitter { debug(`Http2Session ${sessionName(this[kType])}: sending settings`); state.pendingAck++; - const fn = submitSettings.bind(this, settings); + const settingsFn = submitSettings.bind(this, settings); if (state.connecting) { - this.once('connect', fn); + this.once('connect', settingsFn); return; } - fn(); + settingsFn(); } // Destroy the Http2Session @@ -968,14 +968,14 @@ class Http2Session extends EventEmitter { this.on('shutdown', callback); } - const fn = submitShutdown.bind(this, options); + const shutdownFn = submitShutdown.bind(this, options); if (state.connecting) { - this.once('connect', fn); + this.once('connect', shutdownFn); return; } debug(`Http2Session ${sessionName(type)}: sending shutdown`); - fn(); + shutdownFn(); } _onTimeout() { @@ -1379,12 +1379,12 @@ class Http2Stream extends Duplex { if (code < 0 || code > kMaxInt) throw new errors.RangeError('ERR_OUT_OF_RANGE', 'code'); - const fn = submitRstStream.bind(this, code); + const rstStreamFn = submitRstStream.bind(this, code); if (this[kID] === undefined) { - this.once('ready', fn); + this.once('ready', rstStreamFn); return; } - fn(); + rstStreamFn(); } rstWithNoError() { @@ -1415,12 +1415,12 @@ class Http2Stream extends Duplex { options = Object.assign({}, options); validatePriorityOptions(options); - const fn = submitPriority.bind(this, options); + const priorityFn = submitPriority.bind(this, options); if (this[kID] === undefined) { - this.once('ready', fn); + this.once('ready', priorityFn); return; } - fn(); + priorityFn(); } // Called by this.destroy().