Skip to content

Commit

Permalink
fixup! events: refactor to use more primordials
Browse files Browse the repository at this point in the history
Co-authored-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
aduh95 and RaisinTen committed Dec 17, 2020
1 parent 5e8dfd7 commit 4355063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/events.js
Expand Up @@ -234,11 +234,11 @@ function addCatch(that, promise, type, args) {
const then = promise.then;

if (typeof then === 'function') {
ReflectApply(then, promise, [undefined, function(err) {
FunctionPrototypeCall(then, promise, undefined, function(err) {
// The callback is called with nextTick to avoid a follow-up
// rejection from this promise.
process.nextTick(emitUnhandledRejectionOrErr, that, err, type, args);
}]);
});
}
} catch (err) {
that.emit('error', err);
Expand Down

0 comments on commit 4355063

Please sign in to comment.