diff options
author | Luca Casonato <hello@lcas.dev> | 2024-09-04 11:04:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 11:04:06 +0200 |
commit | b333dccee82f4328a65d0c3c45c7aa5c19255220 (patch) | |
tree | 6799aff43eb6c8f2e1186c18a2b973b056f967a4 /ext/node/polyfills/_events.mjs | |
parent | 4c3b17b54703b455d8ae4b51354d18838c090658 (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.mjs | 8 |
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); } } |