Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: order declarations in core.js #21689

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 45 additions & 42 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@

/* eslint-disable no-use-before-define */

const internalUtil = require('internal/util');
internalUtil.assertCrypto();
const {
assertCrypto,
customInspectSymbol: kInspect,
promisify
} = require('internal/util');

assertCrypto();

const { internalBinding } = require('internal/bootstrap/loaders');
const { async_id_symbol } = require('internal/async_hooks').symbols;
const { UV_EOF } = process.binding('uv');
const http = require('http');
const binding = process.binding('http2');
const { FileHandle } = process.binding('fs');
const { StreamPipe } = internalBinding('stream_pipe');
const assert = require('assert');
const EventEmitter = require('events');
const fs = require('fs');
const http = require('http');
const net = require('net');
const { Duplex } = require('stream');
const tls = require('tls');
const { URL } = require('url');
const util = require('util');
const fs = require('fs');

const { kIncomingMessage } = require('_http_common');
const { kServerResponse } = require('_http_server');
const { StreamWrap } = require('_stream_wrap');

const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
const { async_id_symbol } = require('internal/async_hooks').symbols;
const { internalBinding } = require('internal/bootstrap/loaders');
const {
codes: {
ERR_HTTP2_ALTSVC_INVALID_ORIGIN,
Expand Down Expand Up @@ -61,30 +70,11 @@ const {
ERR_SOCKET_CLOSED
}
} = require('internal/errors');
const { StreamWrap } = require('_stream_wrap');
const { Duplex } = require('stream');
const { URL } = require('url');
const { utcDate } = require('internal/http');
const { onServerStream,
Http2ServerRequest,
Http2ServerResponse,
} = require('internal/http2/compat');
const { utcDate } = require('internal/http');
const {
promisify,
customInspectSymbol: kInspect
} = internalUtil;
const { isArrayBufferView } = require('internal/util/types');
const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
const { _connectionListener: httpConnectionListener } = http;
const { createPromise, promiseResolve } = process.binding('util');
const debug = util.debuglog('http2');

const kMaxFrameSize = (2 ** 24) - 1;
const kMaxInt = (2 ** 32) - 1;
const kMaxStreams = (2 ** 31) - 1;

// eslint-disable-next-line no-control-regex
const kQuotedString = /^[\x09\x20-\x5b\x5d-\x7e\x80-\xff]*$/;

const {
assertIsObject,
Expand All @@ -104,27 +94,40 @@ const {
updateOptionsBuffer,
updateSettingsBuffer
} = require('internal/http2/util');

const {
kTimeout,
setUnrefTimeout,
validateTimerDuration
} = require('internal/timers');
const {
createWriteWrap,
writeGeneric,
writevGeneric
} = require('internal/stream_base_commons');
const {
kTimeout,
setUnrefTimeout,
validateTimerDuration
} = require('internal/timers');
const { isArrayBufferView } = require('internal/util/types');

const { FileHandle } = process.binding('fs');
const binding = process.binding('http2');
const { ShutdownWrap } = process.binding('stream_wrap');
const { createPromise, promiseResolve } = process.binding('util');
const { UV_EOF } = process.binding('uv');

const { StreamPipe } = internalBinding('stream_pipe');
const { _connectionListener: httpConnectionListener } = http;
const debug = util.debuglog('http2');

const kMaxFrameSize = (2 ** 24) - 1;
const kMaxInt = (2 ** 32) - 1;
const kMaxStreams = (2 ** 31) - 1;

// eslint-disable-next-line no-control-regex
const kQuotedString = /^[\x09\x20-\x5b\x5d-\x7e\x80-\xff]*$/;

const { constants, nameForErrorCode } = binding;

const NETServer = net.Server;
const TLSServer = tls.Server;

const { kIncomingMessage } = require('_http_common');
const { kServerResponse } = require('_http_server');

const kAlpnProtocol = Symbol('alpnProtocol');
const kAuthority = Symbol('authority');
const kEncrypted = Symbol('encrypted');
Expand Down Expand Up @@ -2815,13 +2818,13 @@ function getUnpackedSettings(buf, options = {}) {

// Exports
module.exports = {
connect,
constants,
createServer,
createSecureServer,
getDefaultSettings,
getPackedSettings,
getUnpackedSettings,
createServer,
createSecureServer,
connect,
Http2Session,
Http2Stream,
Http2ServerRequest,
Expand Down