From 823b31e06e2997acece8c9c81d6822d25c90218a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 6 Jul 2018 09:48:59 -0700 Subject: [PATCH] http2: order declarations in core.js Order declarations: * public modules in alphabetical order * internal modules in alphabetical order * process.binding() calls in alphabetical order * exports in alphabetical order PR-URL: https://github.com/nodejs/node/pull/21689 Reviewed-By: Gus Caplan Reviewed-By: Weijia Wang Reviewed-By: James M Snell --- lib/internal/http2/core.js | 70 +++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 8f6c0c20b5b36c..9beb8833a297fb 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -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, @@ -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; @@ -2784,13 +2790,13 @@ function getUnpackedSettings(buf, options = {}) { // Exports module.exports = { + connect, constants, + createServer, + createSecureServer, getDefaultSettings, getPackedSettings, getUnpackedSettings, - createServer, - createSecureServer, - connect, Http2Session, Http2Stream, Http2ServerRequest,