hooks: restore Internet Explorer 11 compatibility.

Compatibility with IE11 regressed in 23eab79946 while working for #3488.
That commit made use of modern js syntax, not supported by IE11.

- Removed arrow functions, replaced with normal functions.
- Removed the spread operator (<...iterable>) and the "new Set()" construct,
  replaced with _.uniq()

At some point IE11 compatibility will be dropped.
Ditching it now, for such a small gain, is not wise.

Fixes #3500.
pull/3526/head
muxator 2018-11-28 20:03:39 +01:00
parent fe20ffa202
commit 0ad8291ae7
1 changed files with 4 additions and 4 deletions

View File

@ -143,11 +143,11 @@ exports.clientPluginNames = function() {
return [];
}
var client_plugin_names = [...new Set(
var client_plugin_names = _.uniq(
exports.plugins.parts
.filter(part => part.hasOwnProperty('client_hooks'))
.map(part => part['plugin'])
)];
.filter(function(part) { return part.hasOwnProperty('client_hooks'); })
.map(function(part) { return part['plugin']; })
);
return client_plugin_names;
}