2 var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
9 return function (d, b) {
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 Object.defineProperty(exports, "__esModule", { value: true });
16 var Scheduler_1 = require("../Scheduler");
17 var AsyncScheduler = (function (_super) {
18 __extends(AsyncScheduler, _super);
19 function AsyncScheduler(SchedulerAction, now) {
20 if (now === void 0) { now = Scheduler_1.Scheduler.now; }
21 var _this = _super.call(this, SchedulerAction, function () {
22 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
23 return AsyncScheduler.delegate.now();
31 _this.scheduled = undefined;
34 AsyncScheduler.prototype.schedule = function (work, delay, state) {
35 if (delay === void 0) { delay = 0; }
36 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
37 return AsyncScheduler.delegate.schedule(work, delay, state);
40 return _super.prototype.schedule.call(this, work, delay, state);
43 AsyncScheduler.prototype.flush = function (action) {
44 var actions = this.actions;
52 if (error = action.execute(action.state, action.delay)) {
55 } while (action = actions.shift());
58 while (action = actions.shift()) {
64 return AsyncScheduler;
65 }(Scheduler_1.Scheduler));
66 exports.AsyncScheduler = AsyncScheduler;
67 //# sourceMappingURL=AsyncScheduler.js.map