Skip to content

Commit

Permalink
lib: remove duplicate require calls in tls.js
Browse files Browse the repository at this point in the history
This commit removes the duplicate require calls of the _tls_common and
_tls_wrap modules. The motivation for this being that even though the
modules are cached the additional calls are unnecessary.

PR-URL: #20099
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
danbev authored and jasnell committed Apr 19, 2018
1 parent a6be27a commit c64632e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const { Buffer } = require('buffer');
const EventEmitter = require('events');
const DuplexPair = require('internal/streams/duplexpair');
const { canonicalizeIP } = process.binding('cares_wrap');
const _tls_common = require('_tls_common');
const _tls_wrap = require('_tls_wrap');

// Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations
// every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more
Expand Down Expand Up @@ -265,12 +267,12 @@ exports.parseCertString = internalUtil.deprecate(
'Please use querystring.parse() instead.',
'DEP0076');

exports.createSecureContext = require('_tls_common').createSecureContext;
exports.SecureContext = require('_tls_common').SecureContext;
exports.TLSSocket = require('_tls_wrap').TLSSocket;
exports.Server = require('_tls_wrap').Server;
exports.createServer = require('_tls_wrap').createServer;
exports.connect = require('_tls_wrap').connect;
exports.createSecureContext = _tls_common.createSecureContext;
exports.SecureContext = _tls_common.SecureContext;
exports.TLSSocket = _tls_wrap.TLSSocket;
exports.Server = _tls_wrap.Server;
exports.createServer = _tls_wrap.createServer;
exports.connect = _tls_wrap.connect;

exports.createSecurePair = internalUtil.deprecate(
function createSecurePair(...args) {
Expand Down

0 comments on commit c64632e

Please sign in to comment.