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

Function callbackTrampoline

lib/internal/async_hooks.js:119–139  ·  view source on GitHub ↗
(asyncId, resource, cb, ...args)

Source from the content-addressed store, hash-verified

117}
118
119function callbackTrampoline(asyncId, resource, cb, ...args) {
120 const index = async_hook_fields[kStackLength] - 1;
121 execution_async_resources[index] = resource;
122
123 if (asyncId !== 0 && hasHooks(kBefore))
124 emitBeforeNative(asyncId);
125
126 let result;
127 if (asyncId === 0 && typeof domain_cb === 'function') {
128 args.unshift(cb);
129 result = ReflectApply(domain_cb, this, args);
130 } else {
131 result = ReflectApply(cb, this, args);
132 }
133
134 if (asyncId !== 0 && hasHooks(kAfter))
135 emitAfterNative(asyncId);
136
137 execution_async_resources.pop();
138 return result;
139}
140
141const topLevelResource = {};
142

Callers

nothing calls this directly

Calls 3

hasHooksFunction · 0.85
unshiftMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…