From 03387ebaa824d56486e86805fc8edfb4af8b60f9 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 13 Oct 2019 11:33:41 +0200 Subject: [PATCH] Update `src/shared/compatibility.js` to only run with `SKIP_BABEL = false` set Rather than specifying certain build targets manually, it seems much more appropriate (and future-proof) to use the `SKIP_BABEL` build target instead. Also, the patch adds a missing `/* eslint no-var: error */` line since I'm touch the file anyway and no code-changes were necessary for it. --- src/shared/compatibility.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js index a886c271c0054..f1e8290272461 100644 --- a/src/shared/compatibility.js +++ b/src/shared/compatibility.js @@ -12,13 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint no-var: error */ const globalScope = require('./global_scope'); -// Skip compatibility checks for the extensions and if we already ran -// this module. -if ((typeof PDFJSDev === 'undefined' || - !PDFJSDev.test('FIREFOX || MOZCENTRAL')) && +// Skip compatibility checks for modern builds and if we already ran the module. +if ((typeof PDFJSDev === 'undefined' || !PDFJSDev.test('SKIP_BABEL')) && !globalScope._pdfjsCompatibilityChecked) { globalScope._pdfjsCompatibilityChecked = true;