Skip to content

Commit 5368297

Browse files
committed
Rebuild with polyfill recursion fix
1 parent f9acb92 commit 5368297

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

dist/html2pdf.bundle.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5478,8 +5478,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
54785478
onRejected = onRejected.bind(self);
54795479
}
54805480

5481-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
5482-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
5481+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
5482+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
54835483

54845484
// Update progress while queuing, calling, and resolving `then`.
54855485
self.updateProgress(null, null, 1, [onFulfilled]);
@@ -5507,8 +5507,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
55075507
onRejected = onRejected.bind(self);
55085508
}
55095509

5510-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
5511-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
5510+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
5511+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
55125512

55135513
// Return the promise, after casting it into a Worker and preserving props.
55145514
var returnVal = Promise.prototype.then.call(selfPromise, onFulfilled, onRejected);

dist/html2pdf.bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/html2pdf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
537537
onRejected = onRejected.bind(self);
538538
}
539539

540-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
541-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
540+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
541+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
542542

543543
// Update progress while queuing, calling, and resolving `then`.
544544
self.updateProgress(null, null, 1, [onFulfilled]);
@@ -566,8 +566,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
566566
onRejected = onRejected.bind(self);
567567
}
568568

569-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
570-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
569+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
570+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
571571

572572
// Return the promise, after casting it into a Worker and preserving props.
573573
var returnVal = Promise.prototype.then.call(selfPromise, onFulfilled, onRejected);

dist/html2pdf.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/include/html2pdf.es.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
532532
onRejected = onRejected.bind(self);
533533
}
534534

535-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
536-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
535+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
536+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
537537

538538
// Update progress while queuing, calling, and resolving `then`.
539539
self.updateProgress(null, null, 1, [onFulfilled]);
@@ -561,8 +561,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
561561
onRejected = onRejected.bind(self);
562562
}
563563

564-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
565-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
564+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
565+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
566566

567567
// Return the promise, after casting it into a Worker and preserving props.
568568
var returnVal = Promise.prototype.then.call(selfPromise, onFulfilled, onRejected);

dist/require/html2pdf.cjs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
536536
onRejected = onRejected.bind(self);
537537
}
538538

539-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
540-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
539+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
540+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
541541

542542
// Update progress while queuing, calling, and resolving `then`.
543543
self.updateProgress(null, null, 1, [onFulfilled]);
@@ -565,8 +565,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
565565
onRejected = onRejected.bind(self);
566566
}
567567

568-
// Cast self into a Promise to avoid es6-promise recursively defining `then`.
569-
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;
568+
// Cast self into a Promise to avoid polyfills recursively defining `then`.
569+
var selfPromise = Promise.toString().indexOf('[native code]') === -1 ? Worker.convert(_extends({}, self), Promise.prototype) : self;
570570

571571
// Return the promise, after casting it into a Worker and preserving props.
572572
var returnVal = Promise.prototype.then.call(selfPromise, onFulfilled, onRejected);

0 commit comments

Comments
 (0)