From d5b6c636b09823bfaa97fe8cd382b654d85d2add Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 2 Oct 2023 21:13:57 +0900 Subject: fix(ext/node): don't call undefined nextTick fn (#20724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `process` global is not defined in this file. Fixes #20441 --------- Co-authored-by: Bartek IwaƄczuk --- ext/node/polyfills/_events.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/node') diff --git a/ext/node/polyfills/_events.mjs b/ext/node/polyfills/_events.mjs index b6f372723..bd9e92d06 100644 --- a/ext/node/polyfills/_events.mjs +++ b/ext/node/polyfills/_events.mjs @@ -42,6 +42,7 @@ import { validateFunction, } from "ext:deno_node/internal/validators.mjs"; import { spliceOne } from "ext:deno_node/_utils.ts"; +import { nextTick } from "ext:deno_node/_process/process.ts"; const kCapture = Symbol("kCapture"); const kErrorMonitor = Symbol("events.errorMonitor"); @@ -206,7 +207,7 @@ function addCatch(that, promise, type, args) { then.call(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); + nextTick(emitUnhandledRejectionOrErr, that, err, type, args); }); } } catch (err) { -- cgit v1.2.3