diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index a6e5c5d46f05fe..92a1f6ad1ed52d 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -654,14 +654,14 @@ Readable.prototype.unpipe = function(dest) { state.pipesCount = 0; state.flowing = false; - for (let i = 0; i < len; i++) + for (var i = 0; i < len; i++) dests[i].emit('unpipe', this); return this; } // try to find the right one. - const i = state.pipes.indexOf(dest); - if (i === -1) + const index = state.pipes.indexOf(dest); + if (index === -1) return this; state.pipes.splice(i, 1); diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 9e6b00ea3d0ebe..fbf1d92c983115 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -34,6 +34,8 @@ exports.SecureContext = SecureContext; exports.createSecureContext = function createSecureContext(options, context) { if (!options) options = {}; + var i; + var len; var secureOptions = options.secureOptions; if (options.honorCipherOrder) @@ -47,7 +49,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // cert's issuer in C++ code. if (options.ca) { if (Array.isArray(options.ca)) { - for (let i = 0, len = options.ca.length; i < len; i++) { + for (i = 0, len = options.ca.length; i < len; i++) { c.context.addCACert(options.ca[i]); } } else { @@ -59,7 +61,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.cert) { if (Array.isArray(options.cert)) { - for (let i = 0; i < options.cert.length; i++) + for (i = 0; i < options.cert.length; i++) c.context.setCert(options.cert[i]); } else { c.context.setCert(options.cert); @@ -72,7 +74,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // which leads to the crash later on. if (options.key) { if (Array.isArray(options.key)) { - for (let i = 0; i < options.key.length; i++) { + for (i = 0; i < options.key.length; i++) { var key = options.key[i]; if (key.passphrase) @@ -103,7 +105,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.crl) { if (Array.isArray(options.crl)) { - for (let i = 0, len = options.crl.length; i < len; i++) { + for (i = 0, len = options.crl.length; i < len; i++) { c.context.addCRL(options.crl[i]); } } else { diff --git a/lib/repl.js b/lib/repl.js index 71c80e05b3cd31..284c4a381d0a3b 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -286,7 +286,7 @@ function REPLServer(prompt, // After executing the current expression, store the values of RegExp // predefined properties back in `savedRegExMatches` - for (let idx = 1; idx < savedRegExMatches.length; idx += 1) { + for (var idx = 1; idx < savedRegExMatches.length; idx += 1) { savedRegExMatches[idx] = RegExp[`$${idx}`]; } diff --git a/lib/tls.js b/lib/tls.js index 2f41dc1f328ccf..565ac1f2770e63 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -90,7 +90,7 @@ function check(hostParts, pattern, wildcards) { return false; // Check host parts from right to left first. - for (let i = hostParts.length - 1; i > 0; i -= 1) + for (var i = hostParts.length - 1; i > 0; i -= 1) if (hostParts[i] !== patternParts[i]) return false; diff --git a/lib/url.js b/lib/url.js index e75b829ddff0f2..a041b77300af9b 100644 --- a/lib/url.js +++ b/lib/url.js @@ -89,7 +89,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (typeof url !== 'string') { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } - + var i, j, k, l; // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 @@ -169,7 +169,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // find the first instance of any hostEndingChars var hostEnd = -1; - for (let i = 0; i < hostEndingChars.length; i++) { + for (i = 0; i < hostEndingChars.length; i++) { const hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; @@ -197,7 +197,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // the host is the remaining to the left of the first non-host char hostEnd = -1; - for (let i = 0; i < nonHostChars.length; i++) { + for (i = 0; i < nonHostChars.length; i++) { const hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; @@ -224,12 +224,12 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); - for (let i = 0, l = hostparts.length; i < l; i++) { + for (i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; - for (let j = 0, k = part.length; j < k; j++) { + for (j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not @@ -294,7 +294,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. - for (let i = 0, l = autoEscape.length; i < l; i++) { + for (i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue;