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

Function makeCallback

test/pummel/test-net-write-callbacks.js:43–56  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

41
42let lastCalled = -1;
43function makeCallback(c) {
44 let called = false;
45 return function() {
46 if (called)
47 throw new Error(`called callback #${c} more than once`);
48 called = true;
49 if (c < lastCalled) {
50 throw new Error(
51 `callbacks out of order. last=${lastCalled} current=${c}`);
52 }
53 lastCalled = c;
54 cbcount++;
55 };
56}
57
58server.listen(0, function() {
59 const client = net.createConnection(server.address().port);

Callers 8

test.jsFile · 0.50
test.jsFile · 0.50
checkDomainsFunction · 0.50
testTimerFunction · 0.50
test.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…