(name, /* options, */ callback)
| 53 | |
| 54 | function resolver(bindingName) { |
| 55 | function query(name, /* options, */ callback) { |
| 56 | let options; |
| 57 | if (arguments.length > 2) { |
| 58 | options = callback; |
| 59 | callback = arguments[2]; |
| 60 | } |
| 61 | |
| 62 | validateString(name, 'name'); |
| 63 | validateFunction(callback, 'callback'); |
| 64 | |
| 65 | const req = new QueryReqWrap(); |
| 66 | req.bindingName = bindingName; |
| 67 | req.callback = callback; |
| 68 | req.hostname = name; |
| 69 | req.oncomplete = onresolve; |
| 70 | req.ttl = !!(options?.ttl); |
| 71 | const err = this._handle[bindingName](req, name); |
| 72 | if (err) throw new DNSException(err, bindingName, name); |
| 73 | if (hasObserver('dns')) { |
| 74 | startPerf(req, kPerfHooksDnsLookupResolveContext, { |
| 75 | type: 'dns', |
| 76 | name: bindingName, |
| 77 | detail: { |
| 78 | host: name, |
| 79 | ttl: req.ttl, |
| 80 | }, |
| 81 | }); |
| 82 | } |
| 83 | return req; |
| 84 | } |
| 85 | ObjectDefineProperty(query, 'name', { __proto__: null, value: bindingName }); |
| 86 | return query; |
| 87 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…