Skip to content

Commit 093a870

Browse files
committed
http2: use more descriptive names
PR-URL: #17328Fixes: #15303 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
1 parent 973b8e0 commit 093a870

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

‎lib/internal/http2/core.js‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -582,15 +582,15 @@ function doShutdown(options){
582582
functionsubmitShutdown(options){
583583
consttype=this[kType];
584584
debug(`Http2Session ${sessionName(type)}: submitting shutdown request`);
585-
constfn=doShutdown.bind(this,options);
585+
constshutdownFn=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
functionfinishSessionDestroy(socket){
@@ -877,12 +877,12 @@ class Http2Session extends EventEmitter{
877877
debug(`Http2Session ${sessionName(this[kType])}: sending settings`);
878878

879879
state.pendingAck++;
880-
constfn=submitSettings.bind(this,settings);
880+
constsettingsFn=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-
constfn=submitShutdown.bind(this,options);
971+
constshutdownFn=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
thrownewerrors.RangeError('ERR_OUT_OF_RANGE','code');
13811381

1382-
constfn=submitRstStream.bind(this,code);
1382+
constrstStreamFn=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-
constfn=submitPriority.bind(this,options);
1418+
constpriorityFn=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)