Merge pull request #11112 from Snuffleupagus/TESTING-rm-version-warn
Remove the API/Worker version warning message in `TESTING` mode
This commit is contained in:
commit
c37a2c0408
@ -109,13 +109,11 @@ var WorkerMessageHandler = {
|
|||||||
var WorkerTasks = [];
|
var WorkerTasks = [];
|
||||||
const verbosity = getVerbosityLevel();
|
const verbosity = getVerbosityLevel();
|
||||||
|
|
||||||
let apiVersion = docParams.apiVersion;
|
const apiVersion = docParams.apiVersion;
|
||||||
let workerVersion =
|
const workerVersion =
|
||||||
typeof PDFJSDev !== 'undefined' ? PDFJSDev.eval('BUNDLE_VERSION') : null;
|
typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('TESTING') ?
|
||||||
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('TESTING')) &&
|
PDFJSDev.eval('BUNDLE_VERSION') : null;
|
||||||
apiVersion === null) {
|
if (apiVersion !== workerVersion) {
|
||||||
warn('Ignoring apiVersion/workerVersion check in TESTING builds.');
|
|
||||||
} else if (apiVersion !== workerVersion) {
|
|
||||||
throw new Error(`The API version "${apiVersion}" does not match ` +
|
throw new Error(`The API version "${apiVersion}" does not match ` +
|
||||||
`the Worker version "${workerVersion}".`);
|
`the Worker version "${workerVersion}".`);
|
||||||
}
|
}
|
||||||
|
@ -395,8 +395,8 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|||||||
}
|
}
|
||||||
return worker.messageHandler.sendWithPromise('GetDocRequest', {
|
return worker.messageHandler.sendWithPromise('GetDocRequest', {
|
||||||
docId,
|
docId,
|
||||||
apiVersion: (typeof PDFJSDev !== 'undefined' ?
|
apiVersion: typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('TESTING') ?
|
||||||
PDFJSDev.eval('BUNDLE_VERSION') : null),
|
PDFJSDev.eval('BUNDLE_VERSION') : null,
|
||||||
source: { // Only send the required properties, and *not* the entire object.
|
source: { // Only send the required properties, and *not* the entire object.
|
||||||
data: source.data,
|
data: source.data,
|
||||||
url: source.url,
|
url: source.url,
|
||||||
|
Loading…
Reference in New Issue
Block a user