From 188ed074a96f341a18f057c535f8e0ba781fdc6d Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 16 Apr 2018 14:59:51 +0200 Subject: [PATCH] lib: make c, ca and certs const in _tls_common PR-URL: https://github.com/nodejs/node/pull/20073 Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- lib/_tls_common.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/_tls_common.js b/lib/_tls_common.js index b669badb701..fb6ac34d1e6 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -88,7 +88,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.honorCipherOrder) secureOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE; - var c = new SecureContext(options.secureProtocol, secureOptions, context); + const c = new SecureContext(options.secureProtocol, secureOptions, context); var i; var val; @@ -96,7 +96,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // NOTE: It's important to add CA before the cert to be able to load // cert's issuer in C++ code. - var ca = options.ca; + const { ca } = options; if (ca) { if (Array.isArray(ca)) { for (i = 0; i < ca.length; ++i) { @@ -112,7 +112,7 @@ exports.createSecureContext = function createSecureContext(options, context) { c.context.addRootCerts(); } - var cert = options.cert; + const { cert } = options; if (cert) { if (Array.isArray(cert)) { for (i = 0; i < cert.length; ++i) {