1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Remove the API/Worker version warning message in TESTING mode

The warning messages turn out to be more annoying than helpful when looking at the `console` during tests, so let's just remove them.
This commit is contained in:
Jonas Jenwald 2019-09-01 16:43:58 +02:00
parent 10165c070e
commit 229f6f34d1
2 changed files with 7 additions and 9 deletions

View file

@ -109,13 +109,11 @@ var WorkerMessageHandler = {
var WorkerTasks = [];
const verbosity = getVerbosityLevel();
let apiVersion = docParams.apiVersion;
let workerVersion =
typeof PDFJSDev !== 'undefined' ? PDFJSDev.eval('BUNDLE_VERSION') : null;
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('TESTING')) &&
apiVersion === null) {
warn('Ignoring apiVersion/workerVersion check in TESTING builds.');
} else if (apiVersion !== workerVersion) {
const apiVersion = docParams.apiVersion;
const workerVersion =
typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('TESTING') ?
PDFJSDev.eval('BUNDLE_VERSION') : null;
if (apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` +
`the Worker version "${workerVersion}".`);
}