Skip to content
Permalink
Browse files

http2: core.js replace var with let

const has to be used in for in loop

PR-URL: #30403
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
DanielSchuech authored and MylesBorins committed Nov 12, 2019
1 parent 1a83c65 commit 68f3dde04bc707ff69d8e726d9a57c4d65192ab9
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/internal/http2/core.js
@@ -590,7 +590,7 @@ function onOrigin(origins) {
if (!session.encrypted || session.destroyed)
return undefined;
const originSet = initOriginSet(session);
for (var n = 0; n < origins.length; n++)
for (let n = 0; n < origins.length; n++)
originSet.add(origins[n]);
session.emit('origin', origins);
}
@@ -1518,7 +1518,7 @@ class ServerHttp2Session extends Http2Session {
let arr = '';
let len = 0;
const count = origins.length;
for (var i = 0; i < count; i++) {
for (let i = 0; i < count; i++) {
let origin = origins[i];
if (typeof origin === 'string') {
origin = (new URL(origin)).origin;
@@ -2150,7 +2150,7 @@ function processHeaders(oldHeaders) {
if (oldHeaders !== null && oldHeaders !== undefined) {
const hop = hasOwnProperty.bind(oldHeaders);
// This loop is here for performance reason. Do not change.
for (var key in oldHeaders) {
for (const key in oldHeaders) {
if (hop(key)) {
headers[key] = oldHeaders[key];
}

0 comments on commit 68f3dde

Please sign in to comment.
You can’t perform that action at this time.