summaryrefslogtreecommitdiff
path: root/lib/timers.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/timers.js')
-rw-r--r--lib/timers.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/timers.js b/lib/timers.js
index 4d41b5dc8a..954c73f602 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -289,7 +289,7 @@ TimerWrap.prototype[kOnTimeout] = function listOnTimeout(now) {
// An optimization so that the try/finally only de-optimizes (since at least v8
// 4.7) what is in this smaller function.
-function tryOnTimeout(timer) {
+function tryOnTimeout(timer, start) {
timer._called = true;
const timerAsyncId = (typeof timer[async_id_symbol] === 'number') ?
timer[async_id_symbol] : null;
@@ -297,7 +297,7 @@ function tryOnTimeout(timer) {
if (timerAsyncId !== null)
emitBefore(timerAsyncId, timer[trigger_async_id_symbol]);
try {
- ontimeout(timer);
+ ontimeout(timer, start);
threw = false;
} finally {
if (timerAsyncId !== null) {
@@ -520,7 +520,7 @@ function unrefdHandle(now) {
try {
// Don't attempt to call the callback if it is not a function.
if (typeof this.owner._onTimeout === 'function') {
- ontimeout(this.owner, now);
+ tryOnTimeout(this.owner, now);
}
} finally {
// Make sure we clean up if the callback is no longer a function