summaryrefslogtreecommitdiff
path: root/ext/node/polyfills
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-11-10 10:49:57 -0800
committerGitHub <noreply@github.com>2023-11-10 11:49:57 -0700
commitdf14835b83085017e9cf9ae66a71cd523385c5c4 (patch)
treed258e907a9f94ebf0cd895b3fcf4441aa6a9f54a /ext/node/polyfills
parentb78c7130e9986ce41284f33a0803ecdf6dd6affd (diff)
fix(ext/node): implement process.geteuid (#21151)
Fixes #21097
Diffstat (limited to 'ext/node/polyfills')
-rw-r--r--ext/node/polyfills/process.ts7
1 files changed, 7 insertions, 0 deletions
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 */