Catch, and propagate, errors in the requestAnimationFrame branch of InternalRenderTask._scheduleNext

To support these changes, `InternalRenderTask._next` now returns a Promise.
This commit is contained in:
Jonas Jenwald 2018-06-13 11:01:58 +02:00
parent 2030d1718f
commit 778981ec89

View File

@ -2455,13 +2455,16 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
_scheduleNext: function InternalRenderTask__scheduleNext() {
if (this.useRequestAnimationFrame && typeof window !== 'undefined') {
window.requestAnimationFrame(this._nextBound);
window.requestAnimationFrame(() => {
this._nextBound().catch(this.callback);
});
} else {
Promise.resolve().then(this._nextBound).catch(this.callback);
}
},
_next: function InternalRenderTask__next() {
return new Promise(() => {
if (this.cancelled) {
return;
}
@ -2479,6 +2482,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
this.callback();
}
}
});
},
};