Skip to content

Commit

Permalink
Merge pull request #9611 from Snuffleupagus/getMainThreadWorkerMessag…
Browse files Browse the repository at this point in the history
…eHandler-non-PRODUCTION

Clean-up `getMainThreadWorkerMessageHandler` for non-PRODUCTION mode
  • Loading branch information
timvandermeij authored Mar 31, 2018
2 parents a8e9f6c + 8b09f7c commit 8512596
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1317,13 +1317,7 @@ var PDFWorker = (function PDFWorkerClosure() {
if (typeof window === 'undefined') {
return null;
}
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
return (window.pdfjsNonProductionPdfWorker &&
window.pdfjsNonProductionPdfWorker.WorkerMessageHandler);
}
// PRODUCTION
return (window.pdfjsWorker &&
window.pdfjsWorker.WorkerMessageHandler);
return (window.pdfjsWorker && window.pdfjsWorker.WorkerMessageHandler);
}

let fakeWorkerFilesLoadedCapability;
Expand Down
4 changes: 2 additions & 2 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1524,11 +1524,11 @@ function loadFakeWorker() {
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
if (typeof SystemJS === 'object') {
SystemJS.import('pdfjs/core/worker').then((worker) => {
window.pdfjsNonProductionPdfWorker = worker;
window.pdfjsWorker = worker;
resolve();
});
} else if (typeof require === 'function') {
window.pdfjsNonProductionPdfWorker = require('../src/core/worker.js');
window.pdfjsWorker = require('../src/core/worker.js');
resolve();
} else {
reject(new Error(
Expand Down

0 comments on commit 8512596

Please sign in to comment.