|
|
|
@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
|
|
|
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PDFJS.version = '1.0.112'; |
|
|
|
|
PDFJS.build = 'e62f18c'; |
|
|
|
|
PDFJS.version = '1.0.114'; |
|
|
|
|
PDFJS.build = '8e517b6'; |
|
|
|
|
|
|
|
|
|
(function pdfjsWrapper() { |
|
|
|
|
// Use strict in our context only - users might not want it
|
|
|
|
@ -977,6 +977,31 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
@@ -977,6 +977,31 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
|
|
|
|
|
}; |
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Promise Capability object. |
|
|
|
|
* |
|
|
|
|
* @typedef {Object} PromiseCapability |
|
|
|
|
* @property {Promise} promise - A promise object. |
|
|
|
|
* @property {function} resolve - Fullfills the promise. |
|
|
|
|
* @property {function} reject - Rejects the promise. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a promise capability object. |
|
|
|
|
* @return {PromiseCapability} A capability object contains: |
|
|
|
|
* - a Promise, resolve and reject methods. |
|
|
|
|
*/ |
|
|
|
|
function createPromiseCapability() { |
|
|
|
|
var capability = {}; |
|
|
|
|
capability.promise = new Promise(function (resolve, reject) { |
|
|
|
|
capability.resolve = resolve; |
|
|
|
|
capability.reject = reject; |
|
|
|
|
}); |
|
|
|
|
return capability; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PDFJS.createPromiseCapability = createPromiseCapability; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Polyfill for Promises: |
|
|
|
|
* The following promise implementation tries to generally implment the |
|
|
|
@ -1014,8 +1039,15 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
@@ -1014,8 +1039,15 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
if (typeof globalScope.Promise.resolve !== 'function') { |
|
|
|
|
globalScope.Promise.resolve = function (x) { |
|
|
|
|
return new globalScope.Promise(function (resolve) { resolve(x); }); |
|
|
|
|
globalScope.Promise.resolve = function (value) { |
|
|
|
|
return new globalScope.Promise(function (resolve) { resolve(value); }); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
if (typeof globalScope.Promise.reject !== 'function') { |
|
|
|
|
globalScope.Promise.reject = function (reason) { |
|
|
|
|
return new globalScope.Promise(function (resolve, reject) { |
|
|
|
|
reject(reason); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
@ -1192,18 +1224,28 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
@@ -1192,18 +1224,28 @@ var LegacyPromise = PDFJS.LegacyPromise = (function LegacyPromiseClosure() {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Checks if the value is likely a promise (has a 'then' function). |
|
|
|
|
* @return {boolean} true if x is thenable |
|
|
|
|
* @return {boolean} true if value is thenable |
|
|
|
|
*/ |
|
|
|
|
Promise.isPromise = function Promise_isPromise(value) { |
|
|
|
|
return value && typeof value.then === 'function'; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates resolved promise |
|
|
|
|
* @param x resolve value |
|
|
|
|
* @param value resolve value |
|
|
|
|
* @returns {Promise} |
|
|
|
|
*/ |
|
|
|
|
Promise.resolve = function Promise_resolve(value) { |
|
|
|
|
return new Promise(function (resolve) { resolve(value); }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates rejected promise |
|
|
|
|
* @param reason rejection value |
|
|
|
|
* @returns {Promise} |
|
|
|
|
*/ |
|
|
|
|
Promise.resolve = function Promise_resolve(x) { |
|
|
|
|
return new Promise(function (resolve) { resolve(x); }); |
|
|
|
|
Promise.reject = function Promise_reject(reason) { |
|
|
|
|
return new Promise(function (resolve, reject) { reject(reason); }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Promise.prototype = { |
|
|
|
|