timers: remove unused repeat param in timer_wrap
The `repeat` param in `start(timeout, repeat)` was 0 in all callsites. PR-URL: https://github.com/nodejs/node/pull/7994 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
dabac8a2fb
commit
1b99093df7
@ -135,7 +135,7 @@ function insert(item, unrefed) {
|
|||||||
list._timer._list = list;
|
list._timer._list = list;
|
||||||
|
|
||||||
if (unrefed === true) list._timer.unref();
|
if (unrefed === true) list._timer.unref();
|
||||||
list._timer.start(msecs, 0);
|
list._timer.start(msecs);
|
||||||
|
|
||||||
lists[msecs] = list;
|
lists[msecs] = list;
|
||||||
list._timer[kOnTimeout] = listOnTimeout;
|
list._timer[kOnTimeout] = listOnTimeout;
|
||||||
@ -173,7 +173,7 @@ function listOnTimeout() {
|
|||||||
if (timeRemaining < 0) {
|
if (timeRemaining < 0) {
|
||||||
timeRemaining = 0;
|
timeRemaining = 0;
|
||||||
}
|
}
|
||||||
this.start(timeRemaining, 0);
|
this.start(timeRemaining);
|
||||||
debug('%d list wait because diff is %d', msecs, diff);
|
debug('%d list wait because diff is %d', msecs, diff);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ exports.setInterval = function(callback, repeat) {
|
|||||||
|
|
||||||
// If timer is unref'd (or was - it's permanently removed from the list.)
|
// If timer is unref'd (or was - it's permanently removed from the list.)
|
||||||
if (this._handle) {
|
if (this._handle) {
|
||||||
this._handle.start(repeat, 0);
|
this._handle.start(repeat);
|
||||||
} else {
|
} else {
|
||||||
timer._idleTimeout = repeat;
|
timer._idleTimeout = repeat;
|
||||||
active(timer);
|
active(timer);
|
||||||
@ -485,7 +485,7 @@ Timeout.prototype.unref = function() {
|
|||||||
this._handle = handle || new TimerWrap();
|
this._handle = handle || new TimerWrap();
|
||||||
this._handle.owner = this;
|
this._handle.owner = this;
|
||||||
this._handle[kOnTimeout] = unrefdHandle;
|
this._handle[kOnTimeout] = unrefdHandle;
|
||||||
this._handle.start(delay, 0);
|
this._handle.start(delay);
|
||||||
this._handle.domain = this.domain;
|
this._handle.domain = this.domain;
|
||||||
this._handle.unref();
|
this._handle.unref();
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,7 @@ class TimerWrap : public HandleWrap {
|
|||||||
CHECK(HandleWrap::IsAlive(wrap));
|
CHECK(HandleWrap::IsAlive(wrap));
|
||||||
|
|
||||||
int64_t timeout = args[0]->IntegerValue();
|
int64_t timeout = args[0]->IntegerValue();
|
||||||
int64_t repeat = args[1]->IntegerValue();
|
int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, 0);
|
||||||
int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, repeat);
|
|
||||||
args.GetReturnValue().Set(err);
|
args.GetReturnValue().Set(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ var kOnTimeout = Timer.kOnTimeout;
|
|||||||
|
|
||||||
var t = new Timer();
|
var t = new Timer();
|
||||||
|
|
||||||
t.start(1000, 0);
|
t.start(1000);
|
||||||
|
|
||||||
t[kOnTimeout] = common.mustCall(function() {
|
t[kOnTimeout] = common.mustCall(function() {
|
||||||
console.log('timeout');
|
console.log('timeout');
|
||||||
|
@ -42,7 +42,7 @@ monoTimer[Timer.kOnTimeout] = function() {
|
|||||||
assert(intervalFired);
|
assert(intervalFired);
|
||||||
};
|
};
|
||||||
|
|
||||||
monoTimer.start(300, 0);
|
monoTimer.start(300);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
timerFired = true;
|
timerFired = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user