diff options
author | Rich Trott <rtrott@gmail.com> | 2016-01-24 21:58:18 -0800 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2016-01-26 20:53:05 +0100 |
commit | 6a73dbad51756ff0ad7c3de06e90852cfd4b8d7d (patch) | |
tree | 750a3339b6293e6e1b579f81e68cbffd7f7429b4 /lib/_tls_common.js | |
parent | 2c426355df2ce2b0143d09af8d777bb433d57dff (diff) | |
download | android-node-v8-6a73dbad51756ff0ad7c3de06e90852cfd4b8d7d.tar.gz android-node-v8-6a73dbad51756ff0ad7c3de06e90852cfd4b8d7d.tar.bz2 android-node-v8-6a73dbad51756ff0ad7c3de06e90852cfd4b8d7d.zip |
tls: scope loop vars with let
`lib/_tls_common.js` had instances of `for` loops that defined variables
with `var` such that they were re-declared in the same scope. This
change scopes those variables with `let` so that they are not
re-declared.
PR-URL: https://github.com/nodejs/node/pull/4853
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'lib/_tls_common.js')
-rw-r--r-- | lib/_tls_common.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 94564ce59c..382ba5e8f4 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -48,7 +48,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // cert's issuer in C++ code. if (options.ca) { if (Array.isArray(options.ca)) { - for (var i = 0, len = options.ca.length; i < len; i++) { + for (let i = 0, len = options.ca.length; i < len; i++) { c.context.addCACert(options.ca[i]); } } else { @@ -60,7 +60,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.cert) { if (Array.isArray(options.cert)) { - for (var i = 0; i < options.cert.length; i++) + for (let i = 0; i < options.cert.length; i++) c.context.setCert(options.cert[i]); } else { c.context.setCert(options.cert); @@ -73,7 +73,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // which leads to the crash later on. if (options.key) { if (Array.isArray(options.key)) { - for (var i = 0; i < options.key.length; i++) { + for (let i = 0; i < options.key.length; i++) { var key = options.key[i]; if (key.passphrase) @@ -108,7 +108,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.crl) { if (Array.isArray(options.crl)) { - for (var i = 0, len = options.crl.length; i < len; i++) { + for (let i = 0, len = options.crl.length; i < len; i++) { c.context.addCRL(options.crl[i]); } } else { |