From 37340e23865b17b1466a7e32997b0add96dd3806 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Wed, 26 Oct 2022 16:37:48 -0400 Subject: chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432) This commit renames `Deno.getUid()` to `Deno.uid()` and renames `Deno.getGid()` to `Deno.gid()`. --- runtime/ops/os.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'runtime/ops') diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs index 2aafdc7a3..35b49217c 100644 --- a/runtime/ops/os.rs +++ b/runtime/ops/os.rs @@ -20,8 +20,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_exit::decl(), op_delete_env::decl(), op_get_env::decl(), - op_getgid::decl(), - op_getuid::decl(), + op_gid::decl(), op_hostname::decl(), op_loadavg::decl(), op_network_interfaces::decl(), @@ -29,6 +28,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_set_env::decl(), op_set_exit_code::decl(), op_system_memory_info::decl(), + op_uid::decl(), ]) } @@ -284,12 +284,12 @@ fn op_system_memory_info( #[cfg(not(windows))] #[op] -fn op_getgid(state: &mut OpState) -> Result, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -299,23 +299,23 @@ fn op_getgid(state: &mut OpState) -> Result, AnyError> { #[cfg(windows)] #[op] -fn op_getgid(state: &mut OpState) -> Result, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; Ok(None) } #[cfg(not(windows))] #[op] -fn op_getuid(state: &mut OpState) -> Result, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -325,11 +325,11 @@ fn op_getuid(state: &mut OpState) -> Result, AnyError> { #[cfg(windows)] #[op] -fn op_getuid(state: &mut OpState) -> Result, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; Ok(None) } -- cgit v1.2.3