Object.values polyfill

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-08-16 07:43:57 +02:00
parent b082278f04
commit 5647f85a3c
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 14 additions and 0 deletions

View File

@ -558,6 +558,20 @@
} }
}); });
function objectValues(obj) {
var res = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
res.push(obj[i]);
}
}
return res;
}
// polyfill
if (!Object.values) {
Object.values = objectValues;
}
var menuActions = Object.values(this.actions.all).filter(function (action) { var menuActions = Object.values(this.actions.all).filter(function (action) {
return action.type !== OCA.Files.FileActions.TYPE_INLINE; return action.type !== OCA.Files.FileActions.TYPE_INLINE;
}); });