From 32b30d519ef0168eeb9e0981bc11c6dc7d4148aa Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 31 Jul 2017 22:06:47 +0200 Subject: [PATCH] dns: name generated functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/14518 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen --- lib/dns.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index 3f27d7401abcae..6946380ae673ce 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -253,7 +253,7 @@ class Resolver { } function resolver(bindingName) { - return function query(name, /* options, */ callback) { + function query(name, /* options, */ callback) { var options; if (arguments.length > 2) { options = callback; @@ -275,7 +275,9 @@ function resolver(bindingName) { var err = this._handle[bindingName](req, name); if (err) throw errnoException(err, bindingName); return req; - }; + } + Object.defineProperty(query, 'name', { value: bindingName }); + return query; } var resolveMap = Object.create(null);