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

Function method

test/parallel/test-debugger-run-restart-init.js:23–31  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

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');

Callers 1

createAgentFunction · 0.70

Calls 2

pushMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected