Skip to content

Commit

Permalink
async_hooks: require parameter in emitBefore
Browse files Browse the repository at this point in the history
Using asyncId as the default triggerAsyncId is wrong. The triggerAsyncId
can actually never be the asyncId.

PR-URL: #14050
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
AndreasMadsen committed Jul 6, 2017
1 parent 4e27aa9 commit 84f9261
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 84f9261

Please sign in to comment.