|
56 | 56 |
|
57 | 57 | class Scheduler { |
58 | 58 | // Next scheduler id. |
59 | | - public nextId: number = 0; |
| 59 | + public nextId: number = 1; |
60 | 60 |
|
61 | 61 | // Scheduler queue with the tuple of end time and callback function - sorted by end time. |
62 | 62 | private _schedulerQueue: ScheduledFunction[] = []; |
|
409 | 409 | case 'macroTask': |
410 | 410 | switch (task.source) { |
411 | 411 | case 'setTimeout': |
412 | | - task.data['handleId'] = |
413 | | - this._setTimeout(task.invoke, task.data['delay'], Array.prototype.slice.call((task.data as any)['args'], 2)); |
| 412 | + task.data['handleId'] = this._setTimeout( |
| 413 | + task.invoke, task.data['delay'], |
| 414 | + Array.prototype.slice.call((task.data as any)['args'], 2)); |
414 | 415 | break; |
415 | 416 | case 'setInterval': |
416 | | - task.data['handleId'] = |
417 | | - this._setInterval(task.invoke, task.data['delay'], Array.prototype.slice.call((task.data as any)['args'], 2)); |
| 417 | + task.data['handleId'] = this._setInterval( |
| 418 | + task.invoke, task.data['delay'], |
| 419 | + Array.prototype.slice.call((task.data as any)['args'], 2)); |
418 | 420 | break; |
419 | 421 | case 'XMLHttpRequest.send': |
420 | 422 | throw new Error( |
|
480 | 482 | } |
481 | 483 | } |
482 | 484 |
|
483 | | - onInvoke(delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function, applyThis: any, applyArgs: any[], source: string): any { |
| 485 | + onInvoke( |
| 486 | + delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function, applyThis: any, |
| 487 | + applyArgs: any[], source: string): any { |
484 | 488 | try { |
485 | 489 | FakeAsyncTestZoneSpec.patchDate(); |
486 | 490 | return delegate.invoke(target, callback, applyThis, applyArgs, source); |
|
0 commit comments