From 44025a3ec12d5d9969a7c2ba1079ba1d196339e0 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Tue, 23 Jan 2018 20:12:03 +0100 Subject: [PATCH] Explicitly state intended support in compatibility.js Add comments with supported browser versions where missing. Method: - Use MDN compat tables if available. - Otherwise test in Chrome (31+) otherwise. (the Chrome Web Store does not update older versions of Chrome, so probably nobody is interested in even older versions, even though there is an existing comment for Chrome<29 at `document.currentScript`). --- src/shared/compatibility.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js index 742d3aa85..a12e93bda 100644 --- a/src/shared/compatibility.js +++ b/src/shared/compatibility.js @@ -75,6 +75,7 @@ PDFJS.compatibilityChecked = true; })(); // Checks if navigator.language is supported +// Support: IE<11 (function checkNavigatorLanguage() { if (typeof navigator === 'undefined') { return; @@ -151,7 +152,7 @@ PDFJS.compatibilityChecked = true; })(); // Provides support for Object.values in legacy browsers. -// Support: IE. +// Support: IE, Chrome<54 (function checkObjectValues() { if (Object.values) { return; @@ -160,7 +161,7 @@ PDFJS.compatibilityChecked = true; })(); // Provides support for Array.prototype.includes in legacy browsers. -// Support: IE. +// Support: IE, Chrome<47 (function checkArrayIncludes() { if (Array.prototype.includes) { return; @@ -169,7 +170,7 @@ PDFJS.compatibilityChecked = true; })(); // Provides support for Math.log2 in legacy browsers. -// Support: IE. +// Support: IE, Chrome<38 (function checkMathLog2() { if (Math.log2) { return; @@ -187,7 +188,7 @@ PDFJS.compatibilityChecked = true; })(); // Provides support for Number.isInteger in legacy browsers. -// Support: IE. +// Support: IE, Chrome<34 (function checkNumberIsInteger() { if (Number.isInteger) { return; @@ -195,6 +196,7 @@ PDFJS.compatibilityChecked = true; Number.isInteger = require('core-js/fn/number/is-integer'); })(); +// Support: IE, Safari<8, Chrome<32 (function checkPromise() { if (globalScope.Promise) { return; @@ -202,6 +204,7 @@ PDFJS.compatibilityChecked = true; globalScope.Promise = require('core-js/fn/promise'); })(); +// Support: IE<11, Safari<8, Chrome<36 (function checkWeakMap() { if (globalScope.WeakMap) { return; @@ -209,6 +212,7 @@ PDFJS.compatibilityChecked = true; globalScope.WeakMap = require('core-js/fn/weak-map'); })(); +// Support: IE, Chrome<32 // Polyfill from https://github.com/Polymer/URL /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */