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
[squash] update comment
  • Loading branch information
AndreasMadsen committed Jul 13, 2017
commit cbd1f78646d9f5255f5d0b6dc031498625b5e70f
6 changes: 3 additions & 3 deletions lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const { pushAsyncIds, popAsyncIds } = async_wrap;
// Using var instead of (preferably const) in order to assign
// tmp_active_hooks_array if a hook is enabled/disabled during hook execution.
var active_hooks_array = [];
// Track whether a hook callback is currently being processed. Used to make
// sure active_hooks_array isn't altered in mid execution if another hook is
// added or removed.
// Use a counter to track whether a hook callback is currently being processed.
// Used to make sure active_hooks_array isn't altered in mid execution if
// another hook is added or removed. A counter is used to track nested calls.
var processing_hook = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly change comment above from simply

Track whether a hook [...]

to something like

Use a counter to track [...] and prevent nested calls [...]

// Use to temporarily store and updated active_hooks_array if the user enables
// or disables a hook while hooks are being processed.
Expand Down