Skip to content

Commit

Permalink
http2: replace var with let/const
Browse files Browse the repository at this point in the history
PR-URL: #30417
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
pc3b3r authored and addaleax committed Nov 30, 2019
1 parent c50bbf5 commit f7ca7e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/internal/http2/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const IDX_OPTIONS_MAX_SESSION_MEMORY = 8;
const IDX_OPTIONS_FLAGS = 9;

function updateOptionsBuffer(options) {
var flags = 0;
let flags = 0;
if (typeof options.maxDeflateDynamicTableSize === 'number') {
flags |= (1 << IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE);
optionsBuffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE] =
Expand Down Expand Up @@ -318,7 +318,7 @@ function getSettings(session, remote) {
}

function updateSettingsBuffer(settings) {
var flags = 0;
let flags = 0;
if (typeof settings.headerTableSize === 'number') {
flags |= (1 << IDX_SETTINGS_HEADER_TABLE_SIZE);
settingsBuffer[IDX_SETTINGS_HEADER_TABLE_SIZE] =
Expand Down Expand Up @@ -527,11 +527,11 @@ const assertWithinRange = hideStackFrames(
function toHeaderObject(headers) {
const obj = Object.create(null);
for (var n = 0; n < headers.length; n = n + 2) {
var name = headers[n];
var value = headers[n + 1];
const name = headers[n];
let value = headers[n + 1];
if (name === HTTP2_HEADER_STATUS)
value |= 0;
var existing = obj[name];
const existing = obj[name];
if (existing === undefined) {
obj[name] = name === HTTP2_HEADER_SET_COOKIE ? [value] : value;
} else if (!kSingleValueHeaders.has(name)) {
Expand Down

0 comments on commit f7ca7e6

Please sign in to comment.