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

Function createAgent

test/parallel/test-debugger-run-restart-init.js:21–40  ·  view source on GitHub ↗
(domain, calls, gates)

Source from the content-addressed store, hash-verified

19}
20
21function createAgent(domain, calls, gates) {
22 const agent = new EventEmitter();
23 const method = (name) => async () => {
24 calls.push(`${domain}.${name}`);
25 if (domain === 'Runtime' && name === 'runIfWaitingForDebugger') {
26 const gate = gates.shift();
27 if (gate) {
28 await gate.promise;
29 }
30 }
31 };
32
33 agent.enable = method('enable');
34 agent.setSamplingInterval = method('setSamplingInterval');
35 agent.setAsyncCallStackDepth = method('setAsyncCallStackDepth');
36 agent.setBlackboxPatterns = method('setBlackboxPatterns');
37 agent.setPauseOnExceptions = method('setPauseOnExceptions');
38 agent.runIfWaitingForDebugger = method('runIfWaitingForDebugger');
39 return agent;
40}
41
42function evalCommand(repl, command) {
43 return new Promise((resolve, reject) => {

Calls 1

methodFunction · 0.70

Tested by

no test coverage detected