Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup rename function
  • Loading branch information
BridgeAR committed Jul 3, 2017
commit 795358aa31f7a7cf3f5154440b266a3fd3c0054a
16 changes: 8 additions & 8 deletions lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ const init_symbol = Symbol('init');
const before_symbol = Symbol('before');
const after_symbol = Symbol('after');
const destroy_symbol = Symbol('destroy');
const emitBeforeN = emitHookFactory(before_symbol, 'emitBeforeN');
const emitAfterN = emitHookFactory(after_symbol, 'emitAfterN');
const emitDestroyN = emitHookFactory(destroy_symbol, 'emitDestroyN');
const emitBeforeNative = emitHookFactory(before_symbol, 'emitBeforeNative');
const emitAfterNative = emitHookFactory(after_symbol, 'emitAfterNative');
const emitDestroyNative = emitHookFactory(destroy_symbol, 'emitDestroyNative');

// Setup the callbacks that node::AsyncWrap will call when there are hooks to
// process. They use the same functions as the JS embedder API. These callbacks
// are setup immediately to prevent async_wrap.setupHooks() from being hijacked
// and the cost of doing so is negligible.
async_wrap.setupHooks({ init,
before: emitBeforeN,
after: emitAfterN,
destroy: emitDestroyN });
before: emitBeforeNative,
after: emitAfterNative,
destroy: emitDestroyNative });

// Used to fatally abort the process if a callback throws.
function fatalError(e) {
Expand Down Expand Up @@ -391,7 +391,7 @@ function emitBeforeS(asyncId, triggerAsyncId = asyncId) {

if (async_hook_fields[kBefore] === 0)
return;
emitBeforeN(asyncId);
emitBeforeNative(asyncId);
}


Expand All @@ -400,7 +400,7 @@ function emitBeforeS(asyncId, triggerAsyncId = asyncId) {
// after callbacks.
function emitAfterS(asyncId) {
if (async_hook_fields[kAfter] > 0)
emitAfterN(asyncId);
emitAfterNative(asyncId);

popAsyncIds(asyncId);
}
Expand Down