From 08281547257bc3ba4a45314faa82e9d7266703c4 Mon Sep 17 00:00:00 2001 From: Dmitriy Kikinskiy Date: Wed, 6 Nov 2019 13:32:31 +0300 Subject: [PATCH] dns: switch var to const/let MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simple exchange var to const/let. PR-URL: https://github.com/nodejs/node/pull/30302 Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Michael Dawson Reviewed-By: Gireesh Punathil --- lib/dns.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index b5a528ead13798..2a4dd15c5edeac 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -73,7 +73,7 @@ function onlookupall(err, addresses) { } const family = this.family; - for (var i = 0; i < addresses.length; i++) { + for (let i = 0; i < addresses.length; i++) { const addr = addresses[i]; addresses[i] = { address: addr, @@ -88,10 +88,10 @@ function onlookupall(err, addresses) { // Easy DNS A/AAAA look up // lookup(hostname, [options,] callback) function lookup(hostname, options, callback) { - var hints = 0; - var family = -1; - var all = false; - var verbatim = false; + let hints = 0; + let family = -1; + let all = false; + let verbatim = false; // Parse arguments if (hostname && typeof hostname !== 'string') { @@ -206,7 +206,7 @@ function onresolve(err, result, ttls) { function resolver(bindingName) { function query(name, /* options, */ callback) { - var options; + let options; if (arguments.length > 2) { options = callback; callback = arguments[2]; @@ -248,7 +248,7 @@ Resolver.prototype.reverse = resolver('getHostByAddr'); Resolver.prototype.resolve = resolve; function resolve(hostname, rrtype, callback) { - var resolver; + let resolver; if (typeof rrtype === 'string') { resolver = resolveMap[rrtype]; } else if (typeof rrtype === 'function') {