Avoid the release of Zalgo (#1295)

This commit is contained in:
Tomas Della Vedova
2020-09-10 15:27:27 +02:00
committed by GitHub
parent 96a54d0539
commit 7f317d3321
4 changed files with 105 additions and 19 deletions

View File

@ -717,7 +717,10 @@ function ESAPI (opts) {
return apis
function handleError (err, callback) {
if (callback) return callback(err, result)
if (callback) {
process.nextTick(callback, err, result)
return { then: noop, catch: noop, abort: noop }
}
return Promise.reject(err)
}
@ -752,4 +755,6 @@ function lazyLoad (file, opts) {
}
}
function noop () {}
module.exports = ESAPI