MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / constructor

Method constructor

modules/network/dns/dnsresolver.js:26–37  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

24 #onResolved;
25 #onError;
26 constructor(options) {
27 this.#onResolved = options.onResolved;
28 this.#onError = options.onError;
29 Net._resolve(options.host, (host, address) => {
30 if (address)
31 this.#onResolved?.(address);
32 else
33 this.#onError?.();
34 });
35
36 this.target ??= options.target;
37 }
38 close() {
39 this.#onResolved = undefined;
40 this.#onError = undefined;

Callers

nothing calls this directly

Calls 1

#onErrorMethod · 0.45

Tested by

no test coverage detected