Skip to content

Commit

Permalink
dns: switch var to const/let
Browse files Browse the repository at this point in the history
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 17, 2019
1 parent 3e4a6a5 commit 0f8662d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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') {
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 0f8662d

Please sign in to comment.