Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: change var to let compact.js #30392

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ class Http2ServerResponse extends Stream {
addTrailers(headers) {
const keys = Object.keys(headers);
let key = '';
for (var i = 0; i < keys.length; i++) {
for (let i = 0; i < keys.length; i++) {
key = keys[i];
this.setTrailer(key, headers[key]);
}
Expand Down Expand Up @@ -606,7 +606,7 @@ class Http2ServerResponse extends Stream {
if (headers === undefined && typeof statusMessage === 'object')
headers = statusMessage;

var i;
let i;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move to inside for loop on lines 611 and 618?

for (let i = 0; i < headers.length; i++) {
for (let i = 0; i < keys.length; i++) {

if (Array.isArray(headers)) {
for (i = 0; i < headers.length; i++) {
const header = headers[i];
Expand Down