Skip to content

Commit

Permalink
tls: replace var with let
Browse files Browse the repository at this point in the history
PR-URL: #30308
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
dividead authored and gireeshpunathil committed Nov 12, 2019
1 parent f372867 commit cc6f99d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function loadSession(hello) {
);
const owner = this[owner_symbol];

var once = false;
let once = false;
function onSession(err, session) {
debug('server resumeSession callback(err %j, sess? %s)', err, !!session);
if (once)
Expand Down Expand Up @@ -263,7 +263,7 @@ function onnewsession(sessionId, session) {
if (!owner.server)
return;

var once = false;
let once = false;
const done = () => {
debug('onnewsession done');
if (once)
Expand Down Expand Up @@ -345,7 +345,7 @@ function initRead(tlsSocket, socket) {

// Socket already has some buffered data - emulate receiving it
if (socket && socket.readableLength) {
var buf;
let buf;
while ((buf = socket.read()) !== null)
tlsSocket._handle.receive(buf);
}
Expand Down Expand Up @@ -389,7 +389,7 @@ function TLSSocket(socket, opts) {
this.authorizationError = null;
this[kRes] = null;

var wrap;
let wrap;
if ((socket instanceof net.Socket && socket._handle) || !socket) {
// 1. connected socket
// 2. no socket, one will be created with net.Socket().connect
Expand Down Expand Up @@ -455,7 +455,7 @@ function makeMethodProxy(name) {
return this._parent[name].apply(this._parent, args);
};
}
for (var n = 0; n < proxiedMethods.length; n++) {
for (let n = 0; n < proxiedMethods.length; n++) {
tls_wrap.TLSWrap.prototype[proxiedMethods[n]] =
makeMethodProxy(proxiedMethods[n]);
}
Expand Down Expand Up @@ -493,7 +493,7 @@ TLSSocket.prototype.disableRenegotiation = function disableRenegotiation() {
};

TLSSocket.prototype._wrapHandle = function(wrap) {
var handle;
let handle;

if (wrap)
handle = wrap._handle;
Expand Down Expand Up @@ -1259,7 +1259,7 @@ Server.prototype.addContext = function(servername, context) {
function SNICallback(servername, callback) {
const contexts = this.server._contexts;

for (var i = 0; i < contexts.length; i++) {
for (let i = 0; i < contexts.length; i++) {
const elem = contexts[i];
if (elem[0].test(servername)) {
callback(null, elem[1]);
Expand All @@ -1273,7 +1273,7 @@ function SNICallback(servername, callback) {

// Target API:
//
// var s = tls.connect({port: 8000, host: "google.com"}, function() {
// let s = tls.connect({port: 8000, host: "google.com"}, function() {
// if (!s.authorized) {
// s.destroy();
// return;
Expand Down Expand Up @@ -1374,7 +1374,7 @@ let warnOnAllowUnauthorized = true;
// Arguments: [port,] [host,] [options,] [cb]
exports.connect = function connect(...args) {
args = normalizeConnectArgs(args);
var options = args[0];
let options = args[0];
const cb = args[1];
const allowUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0';

Expand Down

0 comments on commit cc6f99d

Please sign in to comment.