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

Method runInAsyncScope

lib/async_hooks.js:219–232  ·  view source on GitHub ↗
(fn, thisArg, ...args)

Source from the content-addressed store, hash-verified

217 }
218
219 runInAsyncScope(fn, thisArg, ...args) {
220 const asyncId = this[async_id_symbol];
221 emitBefore(asyncId, this[trigger_async_id_symbol], this);
222
223 const contextFrame = this[contextFrameSymbol];
224 const prior = AsyncContextFrame.exchange(contextFrame);
225 try {
226 return ReflectApply(fn, thisArg, args);
227 } finally {
228 AsyncContextFrame.set(prior);
229 if (hasAsyncIdStack())
230 emitAfter(asyncId);
231 }
232 }
233
234 emitDestroy() {
235 if (this[destroyedSymbol] !== undefined) {

Callers 15

bindAsyncResourceFunction · 0.95
runInAsyncScopesFunction · 0.95
recurseFunction · 0.95
tick1Function · 0.95
AgentFunction · 0.80
runFunction · 0.80
onSessionHeadersFunction · 0.80
runMicrotaskFunction · 0.80

Calls 3

hasAsyncIdStackFunction · 0.85
exchangeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected