Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno.ppid returns bigint, although type declarations says it's number #22166

Closed
magurotuna opened this issue Jan 29, 2024 · 0 comments · Fixed by #22169
Closed

Deno.ppid returns bigint, although type declarations says it's number #22166

magurotuna opened this issue Jan 29, 2024 · 0 comments · Fixed by #22169
Labels
bug Something isn't working correctly

Comments

@magurotuna
Copy link
Member

magurotuna commented Jan 29, 2024

Summary

Deno.ppid is supposed to have type of number (according to https://deno.land/[email protected]?s=Deno.ppid), but what we get actually is bigint.

What happens now

Version: Deno 1.40.2

$ deno eval "console.log(typeof Deno.ppid, Deno.ppid)"
bigint 89489n

$ deno --version
deno 1.40.2 (release, aarch64-apple-darwin)
v8 12.1.285.6
typescript 5.3.3

Expected result

typeof Deno.ppid === "number"

Additional note

  • Deno.pid (not ppid) is of type number as expected.
  • Deno.ppid is of type number if we run it in Deno Deploy.
@magurotuna magurotuna added the bug Something isn't working correctly label Jan 29, 2024
littledivy pushed a commit that referenced this issue Feb 1, 2024
This commit adds `ppid` getter for `node:process` to improve Node
compatibility one step further.

There is one problem though, which is that `Deno.ppid`, which
`process.ppid` internally calls, is actually of type `bigint` although
it's supposed to be `number`. I filed an issue for this (#22166). For
the time being, explciit type conversion from `bigint` to `number` is
applied to match the Node.js behavior.
littledivy pushed a commit that referenced this issue Feb 1, 2024
This commit adds `ppid` getter for `node:process` to improve Node
compatibility one step further.

There is one problem though, which is that `Deno.ppid`, which
`process.ppid` internally calls, is actually of type `bigint` although
it's supposed to be `number`. I filed an issue for this (#22166). For
the time being, explciit type conversion from `bigint` to `number` is
applied to match the Node.js behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant