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