Skip to content

Commit beaa7bb

Browse files
danbevjasnell
authored andcommitted
lib: make c, ca and certs const in _tls_common
PR-URL: #20073 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6348ec8 commit beaa7bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/_tls_common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ exports.createSecureContext = function createSecureContext(options, context) {
8888
if (options.honorCipherOrder)
8989
secureOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE;
9090

91-
var c = new SecureContext(options.secureProtocol, secureOptions, context);
91+
const c = new SecureContext(options.secureProtocol, secureOptions, context);
9292
var i;
9393
var val;
9494

9595
if (context) return c;
9696

9797
// NOTE: It's important to add CA before the cert to be able to load
9898
// cert's issuer in C++ code.
99-
var ca = options.ca;
99+
const { ca } = options;
100100
if (ca) {
101101
if (Array.isArray(ca)) {
102102
for (i = 0; i < ca.length; ++i) {
@@ -112,7 +112,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
112112
c.context.addRootCerts();
113113
}
114114

115-
var cert = options.cert;
115+
const { cert } = options;
116116
if (cert) {
117117
if (Array.isArray(cert)) {
118118
for (i = 0; i < cert.length; ++i) {

0 commit comments

Comments
 (0)