mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 04:55:31 +08:00
FIX: Add missing Object.entries polyfill for IE11
This was omitted when IE polyfills were migrated from polyfills.js to ie.js
This commit is contained in:
parent
1921538faa
commit
b4f28ce2b1
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user