timers: remove unused repeat param in timer_wrap · nodejs/node@1b99093

4 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -135,7 +135,7 @@ function insert(item, unrefed) {

135135

list._timer._list = list;

136136
137137

if (unrefed === true) list._timer.unref();

138-

list._timer.start(msecs, 0);

138+

list._timer.start(msecs);

139139
140140

lists[msecs] = list;

141141

list._timer[kOnTimeout] = listOnTimeout;

@@ -173,7 +173,7 @@ function listOnTimeout() {

173173

if (timeRemaining < 0) {

174174

timeRemaining = 0;

175175

}

176-

this.start(timeRemaining, 0);

176+

this.start(timeRemaining);

177177

debug('%d list wait because diff is %d', msecs, diff);

178178

return;

179179

}

@@ -430,7 +430,7 @@ exports.setInterval = function(callback, repeat) {

430430
431431

// If timer is unref'd (or was - it's permanently removed from the list.)

432432

if (this._handle) {

433-

this._handle.start(repeat, 0);

433+

this._handle.start(repeat);

434434

} else {

435435

timer._idleTimeout = repeat;

436436

active(timer);

@@ -485,7 +485,7 @@ Timeout.prototype.unref = function() {

485485

this._handle = handle || new TimerWrap();

486486

this._handle.owner = this;

487487

this._handle[kOnTimeout] = unrefdHandle;

488-

this._handle.start(delay, 0);

488+

this._handle.start(delay);

489489

this._handle.domain = this.domain;

490490

this._handle.unref();

491491

}

Original file line numberDiff line numberDiff line change

@@ -74,8 +74,7 @@ class TimerWrap : public HandleWrap {

7474

CHECK(HandleWrap::IsAlive(wrap));

7575
7676

int64_t timeout = args[0]->IntegerValue();

77-

int64_t repeat = args[1]->IntegerValue();

78-

int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, repeat);

77+

int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, 0);

7978

args.GetReturnValue().Set(err);

8079

}

8180
Original file line numberDiff line numberDiff line change

@@ -6,7 +6,7 @@ var kOnTimeout = Timer.kOnTimeout;

66
77

var t = new Timer();

88
9-

t.start(1000, 0);

9+

t.start(1000);

1010
1111

t[kOnTimeout] = common.mustCall(function() {

1212

console.log('timeout');

Original file line numberDiff line numberDiff line change

@@ -42,7 +42,7 @@ monoTimer[Timer.kOnTimeout] = function() {

4242

assert(intervalFired);

4343

};

4444
45-

monoTimer.start(300, 0);

45+

monoTimer.start(300);

4646
4747

setTimeout(function() {

4848

timerFired = true;