From b4f28ce2b1a32de1992a60f0bc3e43a49fe40710 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 18 Dec 2019 11:36:26 +0000 Subject: [PATCH] FIX: Add missing Object.entries polyfill for IE11 This was omitted when IE polyfills were migrated from polyfills.js to ie.js --- plugins/discourse-internet-explorer/public/js/ie.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/discourse-internet-explorer/public/js/ie.js b/plugins/discourse-internet-explorer/public/js/ie.js index 5d252b97064..6596b4dd2a7 100644 --- a/plugins/discourse-internet-explorer/public/js/ie.js +++ b/plugins/discourse-internet-explorer/public/js/ie.js @@ -1,6 +1,19 @@ /* eslint-disable */ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries +if (!Object.entries) { + Object.entries = function(obj) { + var ownProps = Object.keys(obj), + i = ownProps.length, + resArray = new Array(i); // preallocate the Array + while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]]; + + return resArray; + }; +} + +// adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries +// missing in ie only if (!Object.values) { Object.values = function(obj) { var ownProps = Object.keys(obj),