From 4d0b56f3f7fadac9b44b4d384177e8e2e09db32c Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 31 Jan 2019 14:07:36 -0800 Subject: [PATCH] tls: don't shadow the tls global with a local `tls` shadows the global `tls` require, and isn't indicative of the arument type. PR-URL: https://github.com/nodejs/node/pull/25861 Reviewed-By: Fedor Indutny Reviewed-By: Anna Henningsen --- lib/_tls_wrap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 43947bb8c68b91..cefd321edaf3cc 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -277,19 +277,19 @@ function onerror(err) { // Used by both client and server TLSSockets to start data flowing from _handle, // read(0) causes a StreamBase::ReadStart, via Socket._read. -function initRead(tls, socket) { +function initRead(tlsSocket, socket) { // If we were destroyed already don't bother reading - if (!tls._handle) + if (!tlsSocket._handle) return; // Socket already has some buffered data - emulate receiving it if (socket && socket.readableLength) { var buf; while ((buf = socket.read()) !== null) - tls._handle.receive(buf); + tlsSocket._handle.receive(buf); } - tls.read(0); + tlsSocket.read(0); } /**