Skip to content
Permalink
Browse files

dns: switch var to const/let

Simple exchange var to const/let.

PR-URL: #30302
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
Dmitriy Kikinskiy authored and MylesBorins committed Nov 6, 2019
1 parent bcc00e1 commit 7cf19ab069f32b484b7aef526a7f30401fd88c88
Showing with 7 additions and 7 deletions.
  1. +7 −7 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') {

0 comments on commit 7cf19ab

Please sign in to comment.
You can’t perform that action at this time.