bugfix / testing: Ie11 warning for not having Promises (#4167)

Makes IE11 work again but may cause an issue for plugin testing in IE11.  IE plugin tests in IE11 will probably fail as the plugin code will not execute.
pull/4172/head
John McLear 2020-07-16 09:31:35 +01:00 committed by GitHub
parent e24ef6969e
commit 9bf1b9f2a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -96,11 +96,16 @@ function aCallAll(hook_name, args, cb) {
/* return a Promise if cb is not supplied */
exports.aCallAll = function (hook_name, args, cb) {
if (cb === undefined) {
return new Promise(function(resolve, reject) {
aCallAll(hook_name, args, function(err, res) {
return err ? reject(err) : resolve(res);
try{
return new Promise(function(resolve, reject) {
aCallAll(hook_name, args, function(err, res) {
return err ? reject(err) : resolve(res);
});
});
});
}catch(e){
$.gritter.removeAll();
$.gritter.add("Please update your web browser")
}
} else {
return aCallAll(hook_name, args, cb);
}