diff options
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r-- | lib/_tls_wrap.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 69fc054758..6f08f91c43 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -21,7 +21,11 @@ 'use strict'; -const { Object } = primordials; +const { + ObjectAssign, + ObjectDefineProperty, + ObjectSetPrototypeOf, +} = primordials; const { assertCrypto, @@ -437,8 +441,8 @@ function TLSSocket(socket, opts) { // Read on next tick so the caller has a chance to setup listeners process.nextTick(initRead, this, socket); } -Object.setPrototypeOf(TLSSocket.prototype, net.Socket.prototype); -Object.setPrototypeOf(TLSSocket, net.Socket); +ObjectSetPrototypeOf(TLSSocket.prototype, net.Socket.prototype); +ObjectSetPrototypeOf(TLSSocket, net.Socket); exports.TLSSocket = TLSSocket; const proxiedMethods = [ @@ -531,7 +535,7 @@ TLSSocket.prototype._wrapHandle = function(wrap) { // This eliminates a cyclic reference to TLSWrap // Ref: https://github.com/nodejs/node/commit/f7620fb96d339f704932f9bb9a0dceb9952df2d4 function defineHandleReading(socket, handle) { - Object.defineProperty(handle, 'reading', { + ObjectDefineProperty(handle, 'reading', { get: () => { return socket[kRes].reading; }, @@ -1077,8 +1081,8 @@ function Server(options, listener) { this[kEnableTrace] = options.enableTrace; } -Object.setPrototypeOf(Server.prototype, net.Server.prototype); -Object.setPrototypeOf(Server, net.Server); +ObjectSetPrototypeOf(Server.prototype, net.Server.prototype); +ObjectSetPrototypeOf(Server, net.Server); exports.Server = Server; exports.createServer = function createServer(options, listener) { return new Server(options, listener); @@ -1318,9 +1322,9 @@ function normalizeConnectArgs(listArgs) { // the host/port/path args that it knows about, not the tls options. // This means that options.host overrides a host arg. if (listArgs[1] !== null && typeof listArgs[1] === 'object') { - Object.assign(options, listArgs[1]); + ObjectAssign(options, listArgs[1]); } else if (listArgs[2] !== null && typeof listArgs[2] === 'object') { - Object.assign(options, listArgs[2]); + ObjectAssign(options, listArgs[2]); } return cb ? [options, cb] : [options]; |