mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(node): Implement os.userInfo
properly, add missing toPrimitive
(#24702)
Fixes the implementation of `os.userInfo`, and adds a missing `toPrimitive` for `tmpdir`. This allows us to enable the corresponding node_compat test.
This commit is contained in:
parent
6d44952d4d
commit
6c6bbeb974
9 changed files with 469 additions and 54 deletions
|
@ -1368,8 +1368,12 @@ impl SysDescriptor {
|
|||
match kind.as_str() {
|
||||
"hostname" | "osRelease" | "osUptime" | "loadavg"
|
||||
| "networkInterfaces" | "systemMemoryInfo" | "uid" | "gid" | "cpus"
|
||||
| "homedir" | "getegid" | "username" | "statfs" | "getPriority"
|
||||
| "setPriority" => Ok(Self(kind)),
|
||||
| "homedir" | "getegid" | "statfs" | "getPriority" | "setPriority"
|
||||
| "userInfo" => Ok(Self(kind)),
|
||||
|
||||
// the underlying permission check changed to `userInfo` to better match the API,
|
||||
// alias this to avoid breaking existing projects with `--allow-sys=username`
|
||||
"username" => Ok(Self("userInfo".into())),
|
||||
_ => Err(type_error(format!("unknown system info kind \"{kind}\""))),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue