Skip to content

Commit 658338e

Browse files
jasnellMylesBorins
authored andcommitted
http2: use more descriptive names
PR-URL: #17328 Fixes: #15303 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
1 parent 4994d57 commit 658338e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/internal/http2/core.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -582,15 +582,15 @@ function doShutdown(options) {
582582
function submitShutdown(options) {
583583
const type = this[kType];
584584
debug(`Http2Session ${sessionName(type)}: submitting shutdown request`);
585-
const fn = doShutdown.bind(this, options);
585+
const shutdownFn = doShutdown.bind(this, options);
586586
if (type === NGHTTP2_SESSION_SERVER && options.graceful === true) {
587587
// first send a shutdown notice
588588
this[kHandle].shutdownNotice();
589589
// then, on flip of the event loop, do the actual shutdown
590-
setImmediate(fn);
590+
setImmediate(shutdownFn);
591591
return;
592592
}
593-
fn();
593+
shutdownFn();
594594
}
595595

596596
function finishSessionDestroy(socket) {
@@ -877,12 +877,12 @@ class Http2Session extends EventEmitter {
877877
debug(`Http2Session ${sessionName(this[kType])}: sending settings`);
878878

879879
state.pendingAck++;
880-
const fn = submitSettings.bind(this, settings);
880+
const settingsFn = submitSettings.bind(this, settings);
881881
if (state.connecting) {
882-
this.once('connect', fn);
882+
this.once('connect', settingsFn);
883883
return;
884884
}
885-
fn();
885+
settingsFn();
886886
}
887887

888888
// Destroy the Http2Session
@@ -968,14 +968,14 @@ class Http2Session extends EventEmitter {
968968
this.on('shutdown', callback);
969969
}
970970

971-
const fn = submitShutdown.bind(this, options);
971+
const shutdownFn = submitShutdown.bind(this, options);
972972
if (state.connecting) {
973-
this.once('connect', fn);
973+
this.once('connect', shutdownFn);
974974
return;
975975
}
976976

977977
debug(`Http2Session ${sessionName(type)}: sending shutdown`);
978-
fn();
978+
shutdownFn();
979979
}
980980

981981
_onTimeout() {
@@ -1379,12 +1379,12 @@ class Http2Stream extends Duplex {
13791379
if (code < 0 || code > kMaxInt)
13801380
throw new errors.RangeError('ERR_OUT_OF_RANGE', 'code');
13811381

1382-
const fn = submitRstStream.bind(this, code);
1382+
const rstStreamFn = submitRstStream.bind(this, code);
13831383
if (this[kID] === undefined) {
1384-
this.once('ready', fn);
1384+
this.once('ready', rstStreamFn);
13851385
return;
13861386
}
1387-
fn();
1387+
rstStreamFn();
13881388
}
13891389

13901390
rstWithNoError() {
@@ -1415,12 +1415,12 @@ class Http2Stream extends Duplex {
14151415
options = Object.assign({}, options);
14161416
validatePriorityOptions(options);
14171417

1418-
const fn = submitPriority.bind(this, options);
1418+
const priorityFn = submitPriority.bind(this, options);
14191419
if (this[kID] === undefined) {
1420-
this.once('ready', fn);
1420+
this.once('ready', priorityFn);
14211421
return;
14221422
}
1423-
fn();
1423+
priorityFn();
14241424
}
14251425

14261426
// Called by this.destroy().

0 commit comments

Comments
 (0)