diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/js/30_os.js | 12 | ||||
-rw-r--r-- | runtime/js/90_deno_ns.js | 4 | ||||
-rw-r--r-- | runtime/ops/os.rs | 28 | ||||
-rw-r--r-- | runtime/permissions.rs | 2 |
4 files changed, 23 insertions, 23 deletions
diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js index 4fa71fa83..723b52132 100644 --- a/runtime/js/30_os.js +++ b/runtime/js/30_os.js @@ -33,12 +33,12 @@ return ops.op_network_interfaces(); } - function getGid() { - return ops.op_getgid(); + function gid() { + return ops.op_gid(); } - function getUid() { - return ops.op_getuid(); + function uid() { + return ops.op_uid(); } // This is an internal only method used by the test harness to override the @@ -101,13 +101,13 @@ env, execPath, exit, - getGid, - getUid, + gid, hostname, loadavg, networkInterfaces, osRelease, setExitHandler, systemMemoryInfo, + uid, }; })(this); diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 00d343f74..1f949f512 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -128,8 +128,8 @@ osRelease: __bootstrap.os.osRelease, systemMemoryInfo: __bootstrap.os.systemMemoryInfo, networkInterfaces: __bootstrap.os.networkInterfaces, - getGid: __bootstrap.os.getGid, - getUid: __bootstrap.os.getUid, + gid: __bootstrap.os.gid, + uid: __bootstrap.os.uid, listenDatagram: __bootstrap.net.listenDatagram, umask: __bootstrap.fs.umask, HttpClient: __bootstrap.fetch.HttpClient, 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<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .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<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; Ok(None) } #[cfg(not(windows))] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .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<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; Ok(None) } diff --git a/runtime/permissions.rs b/runtime/permissions.rs index ec2f146ae..95f95b512 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -308,7 +308,7 @@ pub struct SysDescriptor(pub String); pub fn parse_sys_kind(kind: &str) -> Result<&str, AnyError> { match kind { "hostname" | "osRelease" | "loadavg" | "networkInterfaces" - | "systemMemoryInfo" | "getUid" | "getGid" => Ok(kind), + | "systemMemoryInfo" | "uid" | "gid" => Ok(kind), _ => Err(type_error(format!("unknown system info kind \"{}\"", kind))), } } |