From c523948cc761e538ee8063fdfea93603bab95338 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 22 Aug 2017 12:07:25 +0200 Subject: [PATCH] Remove handling of fallback arguments from `PDFViewer.scrollPageIntoView` The method signature was improved in PR 7440, which has now been present in a number of releases (starting with `v1.6.210`). Hence we should be able to remove this now, and just print an error message if the old format is used. --- web/pdf_viewer.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index bffe3ff0b..f58652726 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -581,20 +581,13 @@ class PDFViewer { * @param {ScrollPageIntoViewParameters} params */ scrollPageIntoView(params) { - if (!this.pdfDocument) { - return; - } if ((typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) && (arguments.length > 1 || typeof params === 'number')) { - console.warn('Call of scrollPageIntoView() with obsolete signature.'); - let paramObj = {}; - if (typeof params === 'number') { - paramObj.pageNumber = params; // pageNumber argument was found. - } - if (arguments[1] instanceof Array) { - paramObj.destArray = arguments[1]; // destArray argument was found. - } - params = paramObj; + console.error('Call of scrollPageIntoView() with obsolete signature.'); + return; + } + if (!this.pdfDocument) { + return; } let pageNumber = params.pageNumber || 0; let dest = params.destArray || null;