Skip to content

Commit 725daeb

Browse files
telenordtargos
authored andcommitted
http: http_outgoing rename var to let and const
PR-URL: #30284 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent b840eb7 commit 725daeb

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

‎lib/_http_outgoing.js‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
168168
constkeys=ObjectKeys(val);
169169
// Retain for(;;) loop for performance reasons
170170
// Refs: https://github.com/nodejs/node/pull/30958
171-
for(vari=0;i<keys.length;++i){
171+
for(leti=0;i<keys.length;++i){
172172
constname=keys[i];
173173
headers[name.toLowerCase()]=[name,val[name]];
174174
}
@@ -184,7 +184,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
184184
constkeys=ObjectKeys(headers);
185185
// Retain for(;;) loop for performance reasons
186186
// Refs: https://github.com/nodejs/node/pull/30958
187-
for(vari=0;i<keys.length;++i){
187+
for(leti=0;i<keys.length;++i){
188188
constkey=keys[i];
189189
constval=headers[key][0];
190190
out[key]=val;
@@ -201,7 +201,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
201201
constkeys=ObjectKeys(val);
202202
// Retain for(;;) loop for performance reasons
203203
// Refs: https://github.com/nodejs/node/pull/30958
204-
for(vari=0;i<keys.length;++i){
204+
for(leti=0;i<keys.length;++i){
205205
constheader=headers[keys[i]];
206206
if(header)
207207
header[0]=val[keys[i]];
@@ -223,7 +223,7 @@ OutgoingMessage.prototype._renderHeaders = function _renderHeaders() {
223223
constkeys=ObjectKeys(headersMap);
224224
// Retain for(;;) loop for performance reasons
225225
// Refs: https://github.com/nodejs/node/pull/30958
226-
for(vari=0,l=keys.length;i<l;i++){
226+
for(leti=0,l=keys.length;i<l;i++){
227227
constkey=keys[i];
228228
headers[headersMap[key][0]]=headersMap[key][1];
229229
}
@@ -288,7 +288,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback) {
288288
(encoding==='utf8'||encoding==='latin1'||!encoding)){
289289
data=this._header+data;
290290
}else{
291-
varheader=this._header;
291+
constheader=this._header;
292292
if(this.outputData.length===0){
293293
this.outputData=[{
294294
data: header,
@@ -459,7 +459,7 @@ function processHeader(self, state, key, value, validate) {
459459
if(value.length<2||!isCookieField(key)){
460460
// Retain for(;;) loop for performance reasons
461461
// Refs: https://github.com/nodejs/node/pull/30958
462-
for(vari=0;i<value.length;i++)
462+
for(leti=0;i<value.length;i++)
463463
storeHeader(self,state,key,value[i],validate);
464464
return;
465465
}
@@ -562,7 +562,7 @@ OutgoingMessage.prototype.getHeaders = function getHeaders() {
562562
constkeys=ObjectKeys(headers);
563563
// Retain for(;;) loop for performance reasons
564564
// Refs: https://github.com/nodejs/node/pull/30958
565-
for(vari=0;i<keys.length;++i){
565+
for(leti=0;i<keys.length;++i){
566566
constkey=keys[i];
567567
constval=headers[key][1];
568568
ret[key]=val;
@@ -667,8 +667,9 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
667667
process.nextTick(connectionCorkNT,msg,msg.connection);
668668
}
669669

670-
varlen,ret;
670+
letret;
671671
if(msg.chunkedEncoding&&chunk.length!==0){
672+
letlen;
672673
if(typeofchunk==='string')
673674
len=Buffer.byteLength(chunk,encoding);
674675
else
@@ -702,11 +703,11 @@ OutgoingMessage.prototype.addTrailers = function addTrailers(headers) {
702703
this._trailer='';
703704
constkeys=ObjectKeys(headers);
704705
constisArray=ArrayIsArray(headers);
705-
varfield,value;
706706
// Retain for(;;) loop for performance reasons
707707
// Refs: https://github.com/nodejs/node/pull/30958
708-
for(vari=0,l=keys.length;i<l;i++){
709-
varkey=keys[i];
708+
for(leti=0,l=keys.length;i<l;i++){
709+
letfield,value;
710+
constkey=keys[i];
710711
if(isArray){
711712
field=headers[key][0];
712713
value=headers[key][1];
@@ -823,11 +824,10 @@ OutgoingMessage.prototype._finish = function _finish() {
823824
// to attempt to flush any pending messages out to the socket.
824825
OutgoingMessage.prototype._flush=function_flush(){
825826
constsocket=this.socket;
826-
varret;
827827

828828
if(socket&&socket.writable){
829829
// There might be remaining data in this.output; write it out
830-
ret=this._flushOutput(socket);
830+
constret=this._flushOutput(socket);
831831

832832
if(this.finished){
833833
// This is a queue to the server or client to bring in the next this.
@@ -854,7 +854,7 @@ OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
854854
letret;
855855
// Retain for(;;) loop for performance reasons
856856
// Refs: https://github.com/nodejs/node/pull/30958
857-
for(vari=0;i<outputLength;i++){
857+
for(leti=0;i<outputLength;i++){
858858
const{ data, encoding, callback }=outputData[i];
859859
ret=socket.write(data,encoding,callback);
860860
}

0 commit comments

Comments
 (0)