Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns: switch var to const/let #30302

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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