(domain, client)
| 46 | } = internalBinding('errors'); |
| 47 | |
| 48 | function 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 | |
| 71 | class NodeInspector { |
| 72 | constructor(options, stdin, stdout) { |
no outgoing calls
no test coverage detected
searching dependent graphs…