MCPcopy Index your code
hub / github.com/nodejs/node / createAgentProxy

Function createAgentProxy

lib/internal/debugger/inspect.js:48–69  ·  view source on GitHub ↗
(domain, client)

Source from the content-addressed store, hash-verified

46} = internalBinding('errors');
47
48function createAgentProxy(domain, client) {
49 const agent = new EventEmitter();
50 agent.then = (then, _catch) => {
51 // TODO: potentially fetch the protocol and pretty-print it here.
52 const descriptor = {
53 [util.inspect.custom](depth, { stylize }) {
54 return stylize(`[Agent ${domain}]`, 'special');
55 },
56 };
57 return PromisePrototypeThen(PromiseResolve(descriptor), then, _catch);
58 };
59
60 return new Proxy(agent, {
61 __proto__: null,
62 get(target, name) {
63 if (name in target) return target[name];
64 return function callVirtualMethod(params) {
65 return client.callMethod(`${domain}.${name}`, params);
66 };
67 },
68 });
69}
70
71class NodeInspector {
72 constructor(options, stdin, stdout) {

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…