diff options
Diffstat (limited to 'lib/internal/http2/util.js')
-rw-r--r-- | lib/internal/http2/util.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index a0640b242c..482ae8546a 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -1,6 +1,10 @@ 'use strict'; -const { Math, Object } = primordials; +const { + MathMax, + ObjectCreate, + ObjectKeys, +} = primordials; const binding = internalBinding('http2'); const { @@ -236,12 +240,12 @@ function updateOptionsBuffer(options) { if (typeof options.maxOutstandingSettings === 'number') { flags |= (1 << IDX_OPTIONS_MAX_OUTSTANDING_SETTINGS); optionsBuffer[IDX_OPTIONS_MAX_OUTSTANDING_SETTINGS] = - Math.max(1, options.maxOutstandingSettings); + MathMax(1, options.maxOutstandingSettings); } if (typeof options.maxSessionMemory === 'number') { flags |= (1 << IDX_OPTIONS_MAX_SESSION_MEMORY); optionsBuffer[IDX_OPTIONS_MAX_SESSION_MEMORY] = - Math.max(1, options.maxSessionMemory); + MathMax(1, options.maxSessionMemory); } optionsBuffer[IDX_OPTIONS_FLAGS] = flags; } @@ -249,7 +253,7 @@ function updateOptionsBuffer(options) { function getDefaultSettings() { settingsBuffer[IDX_SETTINGS_FLAGS] = 0; binding.refreshDefaultSettings(); - const holder = Object.create(null); + const holder = ObjectCreate(null); const flags = settingsBuffer[IDX_SETTINGS_FLAGS]; @@ -430,7 +434,7 @@ function mapToHeaders(map, assertValuePseudoHeader = assertValidPseudoHeader) { let ret = ''; let count = 0; - const keys = Object.keys(map); + const keys = ObjectKeys(map); const singles = new Set(); let i; let isArray; @@ -525,7 +529,7 @@ const assertWithinRange = hideStackFrames( ); function toHeaderObject(headers) { - const obj = Object.create(null); + const obj = ObjectCreate(null); for (var n = 0; n < headers.length; n = n + 2) { const name = headers[n]; let value = headers[n + 1]; |