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)]
{