Permalink
Browse files

async_hooks: require parameter in emitBefore

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

PR-URL: #14050
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information...
AndreasMadsen committed Jul 2, 2017
1 parent 4e27aa9 commit 84f9261efd02c7e4ddb087cadf528b2aaed8809c
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/async_hooks.js
View
@@ -377,7 +377,7 @@ function emitHookFactory(symbol, name) {
// Usage: emitBeforeS(asyncId[, triggerAsyncId]). If triggerAsyncId is omitted
// then asyncId will be used instead.
function emitBeforeS(asyncId, triggerAsyncId = asyncId) {
function emitBeforeS(asyncId, triggerAsyncId) {
// CHECK(Number.isSafeInteger(asyncId) && asyncId > 0)
// CHECK(Number.isSafeInteger(triggerAsyncId) && triggerAsyncId > 0)

0 comments on commit 84f9261

Please sign in to comment.