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

Function emitInitScript

lib/internal/async_hooks.js:504–515  ·  view source on GitHub ↗
(asyncId, type, triggerAsyncId, resource, isPromiseHook = false)

Source from the content-addressed store, hash-verified

502
503
504function emitInitScript(asyncId, type, triggerAsyncId, resource, isPromiseHook = false) {
505 // Short circuit all checks for the common case. Which is that no hooks have
506 // been set. Do this to remove performance impact for embedders (and core).
507 if (!hasHooks(kInit))
508 return;
509
510 if (triggerAsyncId === null) {
511 triggerAsyncId = getDefaultTriggerAsyncId();
512 }
513
514 emitInitNative(asyncId, type, triggerAsyncId, resource, isPromiseHook);
515}
516
517
518function emitBeforeScript(asyncId, triggerAsyncId, resource, isPromiseHook = false) {

Callers 1

promiseInitHookFunction · 0.85

Calls 3

hasHooksFunction · 0.85
getDefaultTriggerAsyncIdFunction · 0.85
emitInitNativeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…