Browse Source

PDF.js version 1.9.652 - See mozilla/pdf.js@32aff7889a176e423bb229efba73a2e80fa72165

master v1.9.652
pdfjsbot 7 years ago
parent
commit
ff8816ee6a
  1. 2
      bower.json
  2. 2681
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 2415
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 2
      build/pdf.min.js
  7. 2569
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 2
      build/pdf.worker.min.js
  10. 2
      lib/core/worker.js
  11. 6
      lib/display/api.js
  12. 4
      lib/display/global.js
  13. 4
      lib/pdf.js
  14. 4
      lib/pdf.worker.js
  15. 258
      lib/shared/compatibility.js
  16. 2
      package.json
  17. 2327
      web/compatibility.js
  18. 2
      web/compatibility.js.map

2
bower.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.9.650",
"version": "1.9.652",
"main": [
"build/pdf.js",
"build/pdf.worker.js"

2681
build/pdf.combined.js

File diff suppressed because it is too large Load Diff

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

2415
build/pdf.js

File diff suppressed because it is too large Load Diff

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

2569
build/pdf.worker.js vendored

File diff suppressed because it is too large Load Diff

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
lib/core/worker.js

@ -208,7 +208,7 @@ var WorkerMessageHandler = { @@ -208,7 +208,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '1.9.650';
var workerVersion = '1.9.652';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

6
lib/display/api.js

@ -193,7 +193,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -193,7 +193,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '1.9.650';
var apiVersion = '1.9.652';
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
source.chunkedViewerLoading = !!pdfDataRangeTransport;
@ -1584,8 +1584,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1584,8 +1584,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.650';
exports.build = build = 'a1d61a75';
exports.version = version = '1.9.652';
exports.build = build = '32aff788';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) { @@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.650';
PDFJS.build = 'a1d61a75';
PDFJS.version = '1.9.652';
PDFJS.build = '32aff788';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.9.650';
var pdfjsBuild = 'a1d61a75';
var pdfjsVersion = '1.9.652';
var pdfjsBuild = '32aff788';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
*/
'use strict';
var pdfjsVersion = '1.9.650';
var pdfjsBuild = 'a1d61a75';
var pdfjsVersion = '1.9.652';
var pdfjsBuild = '32aff788';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

258
lib/shared/compatibility.js

@ -686,265 +686,9 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { @@ -686,265 +686,9 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
})();
(function checkPromise() {
if (globalScope.Promise) {
if (typeof globalScope.Promise.all !== 'function') {
globalScope.Promise.all = function (iterable) {
var count = 0,
results = [],
resolve,
reject;
var promise = new globalScope.Promise(function (resolve_, reject_) {
resolve = resolve_;
reject = reject_;
});
iterable.forEach(function (p, i) {
count++;
p.then(function (result) {
results[i] = result;
count--;
if (count === 0) {
resolve(results);
}
}, reject);
});
if (count === 0) {
resolve(results);
}
return promise;
};
}
if (typeof globalScope.Promise.resolve !== 'function') {
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);
});
};
}
if (typeof globalScope.Promise.prototype.catch !== 'function') {
globalScope.Promise.prototype.catch = function (onReject) {
return globalScope.Promise.prototype.then(undefined, onReject);
};
}
return;
}
var STATUS_PENDING = 0;
var STATUS_RESOLVED = 1;
var STATUS_REJECTED = 2;
var REJECTION_TIMEOUT = 500;
var HandlerManager = {
handlers: [],
running: false,
unhandledRejections: [],
pendingRejectionCheck: false,
scheduleHandlers: function scheduleHandlers(promise) {
if (promise._status === STATUS_PENDING) {
return;
}
this.handlers = this.handlers.concat(promise._handlers);
promise._handlers = [];
if (this.running) {
return;
}
this.running = true;
setTimeout(this.runHandlers.bind(this), 0);
},
runHandlers: function runHandlers() {
var RUN_TIMEOUT = 1;
var timeoutAt = Date.now() + RUN_TIMEOUT;
while (this.handlers.length > 0) {
var handler = this.handlers.shift();
var nextStatus = handler.thisPromise._status;
var nextValue = handler.thisPromise._value;
try {
if (nextStatus === STATUS_RESOLVED) {
if (typeof handler.onResolve === 'function') {
nextValue = handler.onResolve(nextValue);
}
} else if (typeof handler.onReject === 'function') {
nextValue = handler.onReject(nextValue);
nextStatus = STATUS_RESOLVED;
if (handler.thisPromise._unhandledRejection) {
this.removeUnhandeledRejection(handler.thisPromise);
}
}
} catch (ex) {
nextStatus = STATUS_REJECTED;
nextValue = ex;
}
handler.nextPromise._updateStatus(nextStatus, nextValue);
if (Date.now() >= timeoutAt) {
break;
}
}
if (this.handlers.length > 0) {
setTimeout(this.runHandlers.bind(this), 0);
return;
}
this.running = false;
},
addUnhandledRejection: function addUnhandledRejection(promise) {
this.unhandledRejections.push({
promise: promise,
time: Date.now()
});
this.scheduleRejectionCheck();
},
removeUnhandeledRejection: function removeUnhandeledRejection(promise) {
promise._unhandledRejection = false;
for (var i = 0; i < this.unhandledRejections.length; i++) {
if (this.unhandledRejections[i].promise === promise) {
this.unhandledRejections.splice(i);
i--;
}
}
},
scheduleRejectionCheck: function scheduleRejectionCheck() {
var _this = this;
if (this.pendingRejectionCheck) {
return;
}
this.pendingRejectionCheck = true;
setTimeout(function () {
_this.pendingRejectionCheck = false;
var now = Date.now();
for (var i = 0; i < _this.unhandledRejections.length; i++) {
if (now - _this.unhandledRejections[i].time > REJECTION_TIMEOUT) {
var unhandled = _this.unhandledRejections[i].promise._value;
var msg = 'Unhandled rejection: ' + unhandled;
if (unhandled.stack) {
msg += '\n' + unhandled.stack;
}
try {
throw new Error(msg);
} catch (_) {
console.warn(msg);
}
_this.unhandledRejections.splice(i);
i--;
}
}
if (_this.unhandledRejections.length) {
_this.scheduleRejectionCheck();
}
}, REJECTION_TIMEOUT);
}
};
var Promise = function Promise(resolver) {
this._status = STATUS_PENDING;
this._handlers = [];
try {
resolver.call(this, this._resolve.bind(this), this._reject.bind(this));
} catch (e) {
this._reject(e);
}
};
Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll;
var deferred = new Promise(function (resolve, reject) {
resolveAll = resolve;
rejectAll = reject;
});
var unresolved = promises.length;
var results = [];
if (unresolved === 0) {
resolveAll(results);
return deferred;
}
function reject(reason) {
if (deferred._status === STATUS_REJECTED) {
return;
}
results = [];
rejectAll(reason);
}
for (var i = 0, ii = promises.length; i < ii; ++i) {
var promise = promises[i];
var resolve = function (i) {
return function (value) {
if (deferred._status === STATUS_REJECTED) {
return;
}
results[i] = value;
unresolved--;
if (unresolved === 0) {
resolveAll(results);
}
};
}(i);
if (Promise.isPromise(promise)) {
promise.then(resolve, reject);
} else {
resolve(promise);
}
}
return deferred;
};
Promise.isPromise = function Promise_isPromise(value) {
return value && typeof value.then === 'function';
};
Promise.resolve = function Promise_resolve(value) {
return new Promise(function (resolve) {
resolve(value);
});
};
Promise.reject = function Promise_reject(reason) {
return new Promise(function (resolve, reject) {
reject(reason);
});
};
Promise.prototype = {
_status: null,
_value: null,
_handlers: null,
_unhandledRejection: null,
_updateStatus: function Promise__updateStatus(status, value) {
if (this._status === STATUS_RESOLVED || this._status === STATUS_REJECTED) {
return;
}
if (status === STATUS_RESOLVED && Promise.isPromise(value)) {
value.then(this._updateStatus.bind(this, STATUS_RESOLVED), this._updateStatus.bind(this, STATUS_REJECTED));
return;
}
this._status = status;
this._value = value;
if (status === STATUS_REJECTED && this._handlers.length === 0) {
this._unhandledRejection = true;
HandlerManager.addUnhandledRejection(this);
}
HandlerManager.scheduleHandlers(this);
},
_resolve: function Promise_resolve(value) {
this._updateStatus(STATUS_RESOLVED, value);
},
_reject: function Promise_reject(reason) {
this._updateStatus(STATUS_REJECTED, reason);
},
then: function Promise_then(onResolve, onReject) {
var nextPromise = new Promise(function (resolve, reject) {
this.resolve = resolve;
this.reject = reject;
});
this._handlers.push({
thisPromise: this,
onResolve: onResolve,
onReject: onReject,
nextPromise: nextPromise
});
HandlerManager.scheduleHandlers(this);
return nextPromise;
},
catch: function Promise_catch(onReject) {
return this.then(undefined, onReject);
}
};
globalScope.Promise = Promise;
globalScope.Promise = require('core-js/fn/promise');
})();
(function checkWeakMap() {
if (globalScope.WeakMap) {

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.9.650",
"version": "1.9.652",
"main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.",
"keywords": [

2327
web/compatibility.js

File diff suppressed because it is too large Load Diff

2
web/compatibility.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save