mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Introduces LegacyPromise; polyfills DOM Promise
This commit is contained in:
parent
122cd150d4
commit
5bf3e44e30
20 changed files with 263 additions and 156 deletions
|
@ -17,7 +17,7 @@
|
|||
/* globals ColorSpace, DeviceCmykCS, DeviceGrayCS, DeviceRgbCS, error,
|
||||
FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, ImageData, isArray, isNum,
|
||||
Pattern, TilingPattern, Util, warn, assert, info,
|
||||
TextRenderingMode, OPS */
|
||||
TextRenderingMode, OPS, Promise */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -508,6 +508,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
var commonObjs = this.commonObjs;
|
||||
var objs = this.objs;
|
||||
var fnId;
|
||||
var deferred = Promise.resolve();
|
||||
|
||||
while (true) {
|
||||
if (stepper && i === stepper.nextBreakPoint) {
|
||||
|
@ -549,7 +550,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
// to continue exeution after a short delay.
|
||||
// However, this is only possible if a 'continueCallback' is passed in.
|
||||
if (continueCallback && Date.now() > endTime) {
|
||||
setTimeout(continueCallback, 0);
|
||||
deferred.then(continueCallback);
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue