From df14835b83085017e9cf9ae66a71cd523385c5c4 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 10 Nov 2023 10:49:57 -0800 Subject: fix(ext/node): implement process.geteuid (#21151) Fixes #21097 --- ext/node/polyfills/process.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index a4fc3317d..860825b3e 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -6,6 +6,7 @@ const internals = globalThis.__bootstrap.internals; const { core } = globalThis.__bootstrap; +const { ops } = core; import { notImplemented, warnNotImplemented } from "ext:deno_node/_utils.ts"; import { EventEmitter } from "node:events"; import Module from "node:module"; @@ -652,6 +653,11 @@ class Process extends EventEmitter { return Deno.uid()!; } + /** This method is removed on Windows */ + geteuid?(): number { + return ops.op_geteuid(); + } + // TODO(kt3k): Implement this when we added -e option to node compat mode _eval: string | undefined = undefined; @@ -693,6 +699,7 @@ class Process extends EventEmitter { if (isWindows) { delete Process.prototype.getgid; delete Process.prototype.getuid; + delete Process.prototype.geteuid; } /** https://nodejs.org/api/process.html#process_process */ -- cgit v1.2.3