Skip to content

Commit

Permalink
Restore IE compatibility
Browse files Browse the repository at this point in the history
With the recent finders implementation we involved `Object.entries(`,
which isn't supported by IE

Since ember supports IE, we should also do it.

see:
 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in
  • Loading branch information
ro0gr committed Mar 19, 2020
1 parent ace5058 commit 8ce4718
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions addon-test-support/-private/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,12 @@ export function every(jqArray, cb) {
*
*/
export function filterWhitelistedOption(options, whitelist) {
const result = {};
for (let [key, value] of Object.entries(options)) {
if(whitelist.includes(key)) {
result[key] = value;
return whitelist.reduce((whitelisted, knownKey) => {
if (knownKey in options) {
whitelisted[knownKey] = options[knownKey];
}
}
return result;
return whitelisted;
}, {});
}

/**
Expand Down

0 comments on commit 8ce4718

Please sign in to comment.