From 0271f1b067be019f67e274802a2c951b29f18ab8 Mon Sep 17 00:00:00 2001 From: Paolo Ceschi Berrini Date: Tue, 12 Nov 2019 15:32:24 +0000 Subject: [PATCH] http2: replace var with let/const PR-URL: https://github.com/nodejs/node/pull/30417 Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: Gireesh Punathil --- lib/internal/http2/util.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index 9cc2a30897b6ae..a0640b242cd8b1 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -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] = @@ -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] = @@ -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)) {