aboutsummaryrefslogtreecommitdiff
path: root/lib/_tls_wrap.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-26 05:21:27 +0100
committerMichaël Zasso <targos@protonmail.com>2019-03-30 13:16:39 +0100
commitf86f5736da72ad4f3fb50692461222590e2f0258 (patch)
tree6fee263bfca24abbf76b7a3f1517b8184c29f077 /lib/_tls_wrap.js
parentf0b3855a90bc5f68fe38ea5e7c69d30ae7d81a27 (diff)
downloadandroid-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.tar.gz
android-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.tar.bz2
android-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.zip
benchmark,lib: change var to const
Refs: https://github.com/nodejs/node/pull/26679 PR-URL: https://github.com/nodejs/node/pull/26915 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r--lib/_tls_wrap.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 44a5994a8d..e7756f4518 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -400,7 +400,7 @@ Object.setPrototypeOf(TLSSocket.prototype, net.Socket.prototype);
Object.setPrototypeOf(TLSSocket, net.Socket);
exports.TLSSocket = TLSSocket;
-var proxiedMethods = [
+const proxiedMethods = [
'ref', 'unref', 'open', 'bind', 'listen', 'connect', 'bind6',
'connect6', 'getsockname', 'getpeername', 'setNoDelay', 'setKeepAlive',
'setSimultaneousAccepts', 'setBlocking',
@@ -459,7 +459,7 @@ TLSSocket.prototype._wrapHandle = function(wrap) {
if (wrap)
handle = wrap._handle;
- var options = this._tlsOptions;
+ const options = this._tlsOptions;
if (!handle) {
handle = options.pipe ?
new Pipe(PipeConstants.SOCKET) :
@@ -522,8 +522,8 @@ TLSSocket.prototype._destroySSL = function _destroySSL() {
// Constructor guts, arbitrarily factored out.
TLSSocket.prototype._init = function(socket, wrap) {
- var options = this._tlsOptions;
- var ssl = this._handle;
+ const options = this._tlsOptions;
+ const ssl = this._handle;
this.server = options.server;
debug('%s _init',
@@ -688,7 +688,7 @@ TLSSocket.prototype._handleTimeout = function() {
};
TLSSocket.prototype._emitTLSError = function(err) {
- var e = this._tlsError(err);
+ const e = this._tlsError(err);
if (e)
this.emit('error', e);
};
@@ -1161,7 +1161,7 @@ Server.prototype.setOptions = deprecate(function(options) {
if (options.dhparam) this.dhparam = options.dhparam;
if (options.sessionTimeout) this.sessionTimeout = options.sessionTimeout;
if (options.ticketKeys) this.ticketKeys = options.ticketKeys;
- var secureOptions = options.secureOptions || 0;
+ const secureOptions = options.secureOptions || 0;
if (options.honorCipherOrder !== undefined)
this.honorCipherOrder = !!options.honorCipherOrder;
else
@@ -1185,7 +1185,7 @@ Server.prototype.addContext = function(servername, context) {
throw new ERR_TLS_REQUIRED_SERVER_NAME();
}
- var re = new RegExp('^' +
+ const re = new RegExp('^' +
servername.replace(/([.^$+?\-\\[\]{}])/g, '\\$1')
.replace(/\*/g, '[^.]*') +
'$');
@@ -1310,7 +1310,7 @@ let warnOnAllowUnauthorized = true;
exports.connect = function connect(...args) {
args = normalizeConnectArgs(args);
var options = args[0];
- var cb = args[1];
+ const cb = args[1];
const allowUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0';
if (allowUnauthorized && warnOnAllowUnauthorized) {
@@ -1341,7 +1341,7 @@ exports.connect = function connect(...args) {
const context = options.secureContext || tls.createSecureContext(options);
- var tlssock = new TLSSocket(options.socket, {
+ const tlssock = new TLSSocket(options.socket, {
pipe: !!options.path,
secureContext: context,
isServer: false,