Skip to content

Commit

Permalink
Rebuild with es6-promise recursion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Feb 25, 2018
1 parent 691024b commit 4788318
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 14 deletions.
16 changes: 13 additions & 3 deletions dist/html2pdf.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5353,9 +5353,13 @@ Worker.prototype.save = function save(filename) {
/* ----- SET / GET ----- */

Worker.prototype.set = function set$$1(opt) {
// TODO: Test null/undefined input to this function.
// TODO: Implement ordered pairs?

// Silently ignore invalid or empty input.
if (objType(opt) !== 'object') {
return this;
}

// Build an array of setter functions to queue.
var fns = Object.keys(opt || {}).map(function (key) {
if (key in Worker.template.prop) {
Expand Down Expand Up @@ -5474,9 +5478,12 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

// Update progress while queuing, calling, and resolving `then`.
self.updateProgress(null, null, 1, [onFulfilled]);
var returnVal = Promise.prototype.then.call(self, function then_pre(val) {
var returnVal = Promise.prototype.then.call(selfPromise, function then_pre(val) {
self.updateProgress(null, onFulfilled);
return val;
}).then(onFulfilled, onRejected).then(function then_post(val) {
Expand All @@ -5500,8 +5507,11 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

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

Expand Down
2 changes: 1 addition & 1 deletion dist/html2pdf.bundle.min.js

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions dist/html2pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,13 @@ Worker.prototype.save = function save(filename) {
/* ----- SET / GET ----- */

Worker.prototype.set = function set$$1(opt) {
// TODO: Test null/undefined input to this function.
// TODO: Implement ordered pairs?

// Silently ignore invalid or empty input.
if (objType(opt) !== 'object') {
return this;
}

// Build an array of setter functions to queue.
var fns = Object.keys(opt || {}).map(function (key) {
if (key in Worker.template.prop) {
Expand Down Expand Up @@ -533,9 +537,12 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

// Update progress while queuing, calling, and resolving `then`.
self.updateProgress(null, null, 1, [onFulfilled]);
var returnVal = Promise.prototype.then.call(self, function then_pre(val) {
var returnVal = Promise.prototype.then.call(selfPromise, function then_pre(val) {
self.updateProgress(null, onFulfilled);
return val;
}).then(onFulfilled, onRejected).then(function then_post(val) {
Expand All @@ -559,8 +566,11 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

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

Expand Down
2 changes: 1 addition & 1 deletion dist/html2pdf.min.js

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions dist/include/html2pdf.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,13 @@ Worker.prototype.save = function save(filename) {
/* ----- SET / GET ----- */

Worker.prototype.set = function set$$1(opt) {
// TODO: Test null/undefined input to this function.
// TODO: Implement ordered pairs?

// Silently ignore invalid or empty input.
if (objType(opt) !== 'object') {
return this;
}

// Build an array of setter functions to queue.
var fns = Object.keys(opt || {}).map(function (key) {
if (key in Worker.template.prop) {
Expand Down Expand Up @@ -528,9 +532,12 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

// Update progress while queuing, calling, and resolving `then`.
self.updateProgress(null, null, 1, [onFulfilled]);
var returnVal = Promise.prototype.then.call(self, function then_pre(val) {
var returnVal = Promise.prototype.then.call(selfPromise, function then_pre(val) {
self.updateProgress(null, onFulfilled);
return val;
}).then(onFulfilled, onRejected).then(function then_post(val) {
Expand All @@ -554,8 +561,11 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

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

Expand Down
16 changes: 13 additions & 3 deletions dist/require/html2pdf.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,13 @@ Worker.prototype.save = function save(filename) {
/* ----- SET / GET ----- */

Worker.prototype.set = function set$$1(opt) {
// TODO: Test null/undefined input to this function.
// TODO: Implement ordered pairs?

// Silently ignore invalid or empty input.
if (objType(opt) !== 'object') {
return this;
}

// Build an array of setter functions to queue.
var fns = Object.keys(opt || {}).map(function (key) {
if (key in Worker.template.prop) {
Expand Down Expand Up @@ -532,9 +536,12 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

// Update progress while queuing, calling, and resolving `then`.
self.updateProgress(null, null, 1, [onFulfilled]);
var returnVal = Promise.prototype.then.call(self, function then_pre(val) {
var returnVal = Promise.prototype.then.call(selfPromise, function then_pre(val) {
self.updateProgress(null, onFulfilled);
return val;
}).then(onFulfilled, onRejected).then(function then_post(val) {
Expand All @@ -558,8 +565,11 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
onRejected = onRejected.bind(self);
}

// Cast self into a Promise to avoid es6-promise recursively defining `then`.
var selfPromise = '_state' in self ? Worker.convert(_extends({}, self), Promise.prototype) : self;

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

Expand Down

0 comments on commit 4788318

Please sign in to comment.