From bcb29063c1c2d01f105a4381ee2b7fe8e4d79a43 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 16 Oct 2017 09:09:08 +0200 Subject: [PATCH] Polyfill `Object.values` and `Array.prototype.includes` using core-js See https://github.com/zloirock/core-js#stage-4-proposals. --- src/shared/compatibility.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js index b7d587349..9eb9b0ae6 100644 --- a/src/shared/compatibility.js +++ b/src/shared/compatibility.js @@ -839,6 +839,25 @@ PDFJS.compatibilityChecked = true; }; })(); +// Provides support for Object.values in legacy browsers. +// Support: IE. +(function checkObjectValues() { + if (Object.values) { + return; + } + Object.values = require('core-js/fn/object/values'); +})(); + +// Provides support for Array.prototype.includes in legacy browsers. +// Support: IE. +(function checkArrayIncludes() { + if (Array.prototype.includes) { + return; + } + Array.prototype.includes = require('core-js/fn/array/includes'); +})(); + + // Provides support for Number.isNaN in legacy browsers. // Support: IE. (function checkNumberIsNaN() {