mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
async_hooks: make AsyncResource match emitInit
AsyncResource previously called emitInitNative. Since AsyncResource is just an abstraction on top of the emitEventScript functions, it should call emitInitScript instead. PR-URL: https://github.com/nodejs/node/pull/14152 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
628485ea01
commit
31417b6882
3 changed files with 18 additions and 21 deletions
|
@ -18,8 +18,8 @@ assert.throws(() => new AsyncResource('invalid_trigger_id', null),
|
|||
/^RangeError: triggerAsyncId must be an unsigned integer$/);
|
||||
|
||||
assert.strictEqual(
|
||||
typeof new AsyncResource('default_trigger_id').triggerAsyncId(),
|
||||
'number'
|
||||
new AsyncResource('default_trigger_id').triggerAsyncId(),
|
||||
async_hooks.executionAsyncId()
|
||||
);
|
||||
|
||||
// create first custom event 'alcazares' with triggerAsyncId derived
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue