From 4355063bfb1529d1907ca27ed23a6dae40be5c91 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 17 Dec 2020 10:11:25 -0500 Subject: [PATCH] fixup! events: refactor to use more primordials Co-authored-by: Darshan Sen --- lib/events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/events.js b/lib/events.js index 8d749dba0df796..5f678dd2b6e87a 100644 --- a/lib/events.js +++ b/lib/events.js @@ -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);