| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -85,6 +85,7 @@ function listOnTimeout() { | |
| if (domain) | ||
| domain.enter(); | ||
| threw = true; | ||
| first._called = true; | ||
| first._onTimeout(); | ||
| if (domain) | ||
| domain.exit(); | ||
| Expand Down Expand Up | @@ -293,6 +294,7 @@ exports.clearInterval = function(timer) { | |
|
|
||
|
|
||
| const Timeout = function(after) { | ||
| this._called = false; | ||
| this._idleTimeout = after; | ||
| this._idlePrev = this; | ||
| this._idleNext = this; | ||
| Expand All | @@ -310,6 +312,10 @@ Timeout.prototype.unref = function() { | |
| var delay = this._idleStart + this._idleTimeout - now; | ||
| if (delay < 0) delay = 0; | ||
| exports.unenroll(this); | ||
|
|
||
| // Prevent running cb again when unref() is called during the same cb | ||
| if (this._called && !this._repeat) return; | ||
|
|
||
| this._handle = new Timer(); | ||
| this._handle[kOnTimeout] = this._onTimeout; | ||
| this._handle.start(delay, 0); | ||
| Expand Down Expand Up | @@ -492,6 +498,7 @@ function unrefTimeout() { | |
| if (domain) domain.enter(); | ||
| threw = true; | ||
| debug('unreftimer firing timeout'); | ||
| first._called = true; | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityStrictly, this one wasn't neccessary to fix the issue, but I thought it's better to track all callback calls if there are more edge cases.
Sorry, something went wrong.
All reactions
|
||
| first._onTimeout(); | ||
| threw = false; | ||
| if (domain) | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityPlease add this._called = false to the constructor.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.