Skip to content

Commit

Permalink
http2: order declarations in core.js
Browse files Browse the repository at this point in the history
Order declarations:

* public modules in alphabetical order
* internal modules in alphabetical order
* process.binding() calls in alphabetical order
* exports in alphabetical order

Backport-PR-URL: #22850
PR-URL: #21689
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and BethGriggs committed Oct 16, 2018
1 parent 2116ace commit 071a022
Showing 1 changed file with 38 additions and 32 deletions.
70 changes: 38 additions & 32 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,38 @@

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

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

assertCrypto();

const { async_id_symbol } = process.binding('async_wrap');
const http = require('http');
const binding = process.binding('http2');
const assert = require('assert');
const { Buffer } = require('buffer');
const EventEmitter = require('events');
const fs = require('fs');
const http = require('http');
const net = require('net');
const { Duplex } = require('stream');
const {
_unrefActive,
enroll,
unenroll
} = require('timers');
const tls = require('tls');
const { URL } = require('url');
const util = require('util');
const fs = require('fs');
const errors = require('internal/errors');

const { StreamWrap } = require('_stream_wrap');
const { Duplex } = require('stream');
const { URL } = require('url');

const errors = require('internal/errors');
const { utcDate } = require('internal/http');
const { onServerStream,
Http2ServerRequest,
Http2ServerResponse,
} = require('internal/http2/compat');
const { utcDate } = require('internal/http');
const {
promisify,
customInspectSymbol: kInspect
} = require('internal/util');
const { isArrayBufferView } = require('internal/util/types');
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 @@ -58,13 +54,23 @@ const {
updateSettingsBuffer
} = require('internal/http2/util');

const {
_unrefActive,
enroll,
unenroll
} = require('timers');
const { isArrayBufferView } = require('internal/util/types');

const { async_id_symbol } = process.binding('async_wrap');
const binding = process.binding('http2');
const { ShutdownWrap, WriteWrap } = process.binding('stream_wrap');
const { createPromise, promiseResolve } = process.binding('util');

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;
Expand Down Expand Up @@ -2784,13 +2790,13 @@ function getUnpackedSettings(buf, options = {}) {

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

0 comments on commit 071a022

Please sign in to comment.