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:
parent
2030d1718f
commit
778981ec89
@ -2455,30 +2455,34 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||||||
|
|
||||||
_scheduleNext: function InternalRenderTask__scheduleNext() {
|
_scheduleNext: function InternalRenderTask__scheduleNext() {
|
||||||
if (this.useRequestAnimationFrame && typeof window !== 'undefined') {
|
if (this.useRequestAnimationFrame && typeof window !== 'undefined') {
|
||||||
window.requestAnimationFrame(this._nextBound);
|
window.requestAnimationFrame(() => {
|
||||||
|
this._nextBound().catch(this.callback);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Promise.resolve().then(this._nextBound).catch(this.callback);
|
Promise.resolve().then(this._nextBound).catch(this.callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_next: function InternalRenderTask__next() {
|
_next: function InternalRenderTask__next() {
|
||||||
if (this.cancelled) {
|
return new Promise(() => {
|
||||||
return;
|
if (this.cancelled) {
|
||||||
}
|
return;
|
||||||
this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList,
|
|
||||||
this.operatorListIdx,
|
|
||||||
this._continueBound,
|
|
||||||
this.stepper);
|
|
||||||
if (this.operatorListIdx === this.operatorList.argsArray.length) {
|
|
||||||
this.running = false;
|
|
||||||
if (this.operatorList.lastChunk) {
|
|
||||||
this.gfx.endDrawing();
|
|
||||||
if (this._canvas) {
|
|
||||||
canvasInRendering.delete(this._canvas);
|
|
||||||
}
|
|
||||||
this.callback();
|
|
||||||
}
|
}
|
||||||
}
|
this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList,
|
||||||
|
this.operatorListIdx,
|
||||||
|
this._continueBound,
|
||||||
|
this.stepper);
|
||||||
|
if (this.operatorListIdx === this.operatorList.argsArray.length) {
|
||||||
|
this.running = false;
|
||||||
|
if (this.operatorList.lastChunk) {
|
||||||
|
this.gfx.endDrawing();
|
||||||
|
if (this._canvas) {
|
||||||
|
canvasInRendering.delete(this._canvas);
|
||||||
|
}
|
||||||
|
this.callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user