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

Function promiseAfterHook

lib/internal/async_hooks.js:354–368  ·  view source on GitHub ↗
(promise)

Source from the content-addressed store, hash-verified

352}
353
354function promiseAfterHook(promise) {
355 trackPromise(promise);
356 const asyncId = promise[async_id_symbol];
357 if (hasHooks(kAfter)) {
358 emitAfterNative(asyncId, true);
359 }
360 if (asyncId === executionAsyncId()) {
361 // This condition might not be true if async_hooks was enabled during
362 // the promise callback execution.
363 // Popping it off the stack can be skipped in that case, because it is
364 // known that it would correspond to exactly one call with
365 // PromiseHookType::kBefore that was not witnessed by the PromiseHook.
366 popAsyncContext(asyncId);
367 }
368}
369
370function promiseResolveHook(promise) {
371 trackPromise(promise);

Callers

nothing calls this directly

Calls 4

trackPromiseFunction · 0.85
hasHooksFunction · 0.85
executionAsyncIdFunction · 0.85
popAsyncContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…