Skip to content

Commit

Permalink
http2: destructure constants from require call
Browse files Browse the repository at this point in the history
PR-URL: #28176
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
dnalborczyk authored and targos committed Aug 2, 2019
1 parent d0d3149 commit fa82cbc
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit fa82cbc

Please sign in to comment.