1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

fix(runtime): return number from op_ppid instead of bigint (#22169)

Fixes #22166
This commit is contained in:
Yusuke Tanaka 2024-01-30 15:34:31 +09:00 committed by GitHub
parent 345423cf76
commit ab8b1b11d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -158,10 +158,12 @@ Deno.test({ permissions: { env: true } }, function envInvalidChars() {
});
Deno.test(function osPid() {
assertEquals(typeof Deno.pid, "number");
assert(Deno.pid > 0);
});
Deno.test(function osPpid() {
assertEquals(typeof Deno.ppid, "number");
assert(Deno.ppid > 0);
});

View file

@ -32,7 +32,7 @@ fn op_main_module(state: &mut OpState) -> Result<String, AnyError> {
/// This is an op instead of being done at initialization time because
/// it's expensive to retrieve the ppid on Windows.
#[op2(fast)]
#[bigint]
#[number]
pub fn op_ppid() -> i64 {
#[cfg(windows)]
{