@@ -192,21 +192,21 @@ exports.setTimeout = function(callback, after) {
192
192
case 2 :
193
193
break ;
194
194
case 3 :
195
- ontimeout = callback . bind ( timer , arguments [ 2 ] ) ;
195
+ ontimeout = ( ) => callback . call ( timer , arguments [ 2 ] ) ;
196
196
break ;
197
197
case 4 :
198
- ontimeout = callback . bind ( timer , arguments [ 2 ] , arguments [ 3 ] ) ;
198
+ ontimeout = ( ) => callback . call ( timer , arguments [ 2 ] , arguments [ 3 ] ) ;
199
199
break ;
200
200
case 5 :
201
201
ontimeout =
202
- callback . bind ( timer , arguments [ 2 ] , arguments [ 3 ] , arguments [ 4 ] ) ;
202
+ ( ) => callback . call ( timer , arguments [ 2 ] , arguments [ 3 ] , arguments [ 4 ] ) ;
203
203
break ;
204
204
// slow case
205
205
default :
206
206
var args = new Array ( length - 2 ) ;
207
207
for ( var i = 2 ; i < length ; i ++ )
208
208
args [ i - 2 ] = arguments [ i ] ;
209
- ontimeout = callback . apply . bind ( callback , timer , args ) ;
209
+ ontimeout = ( ) => callback . apply ( timer , args ) ;
210
210
break ;
211
211
}
212
212
timer . _onTimeout = ontimeout ;
@@ -247,20 +247,20 @@ exports.setInterval = function(callback, repeat) {
247
247
case 2 :
248
248
break ;
249
249
case 3 :
250
- ontimeout = callback . bind ( timer , arguments [ 2 ] ) ;
250
+ ontimeout = ( ) => callback . call ( timer , arguments [ 2 ] ) ;
251
251
break ;
252
252
case 4 :
253
- ontimeout = callback . bind ( timer , arguments [ 2 ] , arguments [ 3 ] ) ;
253
+ ontimeout = ( ) => callback . call ( timer , arguments [ 2 ] , arguments [ 3 ] ) ;
254
254
break ;
255
255
case 5 :
256
256
ontimeout =
257
- callback . bind ( timer , arguments [ 2 ] , arguments [ 3 ] , arguments [ 4 ] ) ;
257
+ ( ) => callback . call ( timer , arguments [ 2 ] , arguments [ 3 ] , arguments [ 4 ] ) ;
258
258
break ;
259
259
default :
260
260
var args = new Array ( length - 2 ) ;
261
261
for ( var i = 2 ; i < length ; i += 1 )
262
262
args [ i - 2 ] = arguments [ i ] ;
263
- ontimeout = callback . apply . bind ( callback , timer , args ) ;
263
+ ontimeout = ( ) => callback . apply ( timer , args ) ;
264
264
break ;
265
265
}
266
266
timer . _onTimeout = wrapper ;
@@ -272,7 +272,7 @@ exports.setInterval = function(callback, repeat) {
272
272
return timer ;
273
273
274
274
function wrapper ( ) {
275
- timer . _repeat . call ( this ) ;
275
+ timer . _repeat ( ) ;
276
276
277
277
// Timer might be closed - no point in restarting it
278
278
if ( ! timer . _repeat )
0 commit comments