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 <trev.norris@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
AndreasMadsen authored and addaleax committed Jul 18, 2017
1 parent 9f66f19 commit 544300e
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 544300e

Please sign in to comment.