summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_events.mjs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-09-04 11:04:06 +0200
committerGitHub <noreply@github.com>2024-09-04 11:04:06 +0200
commitb333dccee82f4328a65d0c3c45c7aa5c19255220 (patch)
tree6799aff43eb6c8f2e1186c18a2b973b056f967a4 /ext/node/polyfills/_events.mjs
parent4c3b17b54703b455d8ae4b51354d18838c090658 (diff)
feat(cli): give access to `process` global everywhere (#25291)
Diffstat (limited to 'ext/node/polyfills/_events.mjs')
-rw-r--r--ext/node/polyfills/_events.mjs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/node/polyfills/_events.mjs b/ext/node/polyfills/_events.mjs
index bb3498594..12b0935e6 100644
--- a/ext/node/polyfills/_events.mjs
+++ b/ext/node/polyfills/_events.mjs
@@ -46,7 +46,6 @@ import {
} from "ext:deno_node/internal/validators.mjs";
import { spliceOne } from "ext:deno_node/_utils.ts";
import { nextTick } from "ext:deno_node/_process/process.ts";
-import { nodeGlobals } from "ext:deno_node/00_globals.js";
const kCapture = Symbol("kCapture");
const kErrorMonitor = Symbol("events.errorMonitor");
@@ -55,6 +54,11 @@ const kMaxEventTargetListenersWarned = Symbol(
"events.maxEventTargetListenersWarned",
);
+let process;
+export function setProcess(p) {
+ process = p;
+}
+
/**
* Creates a new `EventEmitter` instance.
* @param {{ captureRejections?: boolean; }} [opts]
@@ -469,7 +473,7 @@ function _addListener(target, type, listener, prepend) {
w.emitter = target;
w.type = type;
w.count = existing.length;
- nodeGlobals.process.emitWarning(w);
+ process.emitWarning(w);
}
}