Skip to content
Permalink
Browse files

http2: destructure constants from require call

PR-URL: #28176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
dnalborczyk authored and targos committed Jun 11, 2019
1 parent d0d3149 commit fa82cbc6cb002e7894431a93950a92a9000d4e94
Showing with 15 additions and 15 deletions.
  1. +15 −15 lib/internal/http2/compat.js
@@ -5,7 +5,21 @@ const { Object, ObjectPrototype, Reflect } = primordials;
const assert = require('internal/assert');
const Stream = require('stream');
const { Readable } = Stream;
const { constants } = internalBinding('http2');
const {
constants: {
HTTP2_HEADER_AUTHORITY,
HTTP2_HEADER_CONNECTION,
HTTP2_HEADER_METHOD,
HTTP2_HEADER_PATH,
HTTP2_HEADER_SCHEME,
HTTP2_HEADER_STATUS,

HTTP_STATUS_CONTINUE,
HTTP_STATUS_EXPECTATION_FAILED,
HTTP_STATUS_METHOD_NOT_ALLOWED,
HTTP_STATUS_OK
}
} = internalBinding('http2');
const {
codes: {
ERR_HTTP2_HEADERS_SENT,
@@ -35,20 +49,6 @@ const kRawTrailers = Symbol('rawTrailers');
const kSetHeader = Symbol('setHeader');
const kAborted = Symbol('aborted');

const {
HTTP2_HEADER_AUTHORITY,
HTTP2_HEADER_CONNECTION,
HTTP2_HEADER_METHOD,
HTTP2_HEADER_PATH,
HTTP2_HEADER_SCHEME,
HTTP2_HEADER_STATUS,

HTTP_STATUS_CONTINUE,
HTTP_STATUS_EXPECTATION_FAILED,
HTTP_STATUS_METHOD_NOT_ALLOWED,
HTTP_STATUS_OK
} = constants;

let statusMessageWarned = false;
let statusConnectionHeaderWarned = false;

0 comments on commit fa82cbc

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