From 4c0c7e5dc7d5d30683b7ec0525134a7bfc466222 Mon Sep 17 00:00:00 2001 From: jesse Date: Wed, 20 Mar 2019 08:18:48 +0900 Subject: [PATCH 1/2] http2: reduce usage of public require('util') in core.js --- lib/internal/http2/core.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 4893cdc96b0b9b..ca58c595d6ea1c 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -7,6 +7,8 @@ const { customInspectSymbol: kInspect, promisify } = require('internal/util'); +const { debuglog } = require('internal/util/debuglog') +const { format } = require('internal/util/inspect') assertCrypto(); @@ -18,8 +20,6 @@ const net = require('net'); const { Duplex } = require('stream'); const tls = require('tls'); const { URL } = require('url'); -const util = require('util'); - const { kIncomingMessage } = require('_http_common'); const { kServerResponse } = require('_http_server'); const JSStreamSocket = require('internal/js_stream_socket'); @@ -132,7 +132,7 @@ const { UV_EOF } = internalBinding('uv'); const { StreamPipe } = internalBinding('stream_pipe'); const { _connectionListener: httpConnectionListener } = http; -const debug = util.debuglog('http2'); +const debug = debuglog('http2'); const kMaxFrameSize = (2 ** 24) - 1; const kMaxInt = (2 ** 32) - 1; @@ -1085,7 +1085,7 @@ class Http2Session extends EventEmitter { localSettings: this.localSettings, remoteSettings: this.remoteSettings }; - return `Http2Session ${util.format(obj)}`; + return `Http2Session ${format(obj)}`; } // The socket owned by this session @@ -1666,7 +1666,7 @@ class Http2Stream extends Duplex { readableState: this._readableState, writableState: this._writableState }; - return `Http2Stream ${util.format(obj)}`; + return `Http2Stream ${format(obj)}`; } get bufferSize() { From 8e7ac615e5c7e477cc80142d2a4cc81fdbe91bc7 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Wed, 20 Mar 2019 09:04:40 +0900 Subject: [PATCH 2/2] http2: apply lint to core.js --- lib/internal/http2/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index ca58c595d6ea1c..b71886802f26d9 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -7,8 +7,8 @@ const { customInspectSymbol: kInspect, promisify } = require('internal/util'); -const { debuglog } = require('internal/util/debuglog') -const { format } = require('internal/util/inspect') +const { debuglog } = require('internal/util/debuglog'); +const { format } = require('internal/util/inspect'); assertCrypto();