Skip to content

async_hooks: cleanup emitBefore and emitAfter in timers and nextTick

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

async_hooks, process, timers

async_hooks: use common emitBefore and emitAfter

  • Timers and nextTick have special emitBefore and emitAfter functions for performance reasons. But if the assert in async_hooks.emitBefore is removed there is no difference.

edit: the checks are already included in pushAsyncIds.

async_hooks: require parameter in emitBefore

  • Using asyncId as the default triggerAsyncId is wrong. The triggerAsyncId can actually never be the asyncId.

/cc @nodejs/async_hooks

Merge request reports

Loading