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

Error getting process.uptime when called without bound this #23761

Closed
beetcb opened this issue May 10, 2024 · 3 comments · Fixed by #23786
Closed

Error getting process.uptime when called without bound this #23761

beetcb opened this issue May 10, 2024 · 3 comments · Fixed by #23786
Labels
bug Something isn't working node compat

Comments

@beetcb
Copy link

beetcb commented May 10, 2024

Version: Deno 1.42.4
Issue: When using npm specifiers, the bundled process.uptime reference appears to be lost.
To reproduce: Run deno repl and compare with node.
image

Please take a look at this issue, thank you.

@beetcb
Copy link
Author

beetcb commented May 10, 2024

Here is the bundled code:

image image

@dsherret dsherret changed the title Undefined this when using npm specifiers Error getting process.uptime May 10, 2024
@dsherret dsherret added bug Something isn't working node compat labels May 10, 2024
@dsherret dsherret changed the title Error getting process.uptime Error getting process.uptime when not called on prototype May 10, 2024
@dsherret dsherret changed the title Error getting process.uptime when not called on prototype Error getting process.uptime when called without bound this May 10, 2024
satyarohith added a commit that referenced this issue May 12, 2024
Fixes #23761

Co-authored-by: Satya Rohith <me@satyarohith.com>
@beetcb
Copy link
Author

beetcb commented May 14, 2024

Thank you for fixing that issue.

Just curious, how does Node.js work without this? @satyarohith

@satyarohith
Copy link
Member

Thank you for fixing that issue.

Just curious, how does Node.js work without this? @satyarohith

Even though the API exposed is the same, the implementation is different in Node.js and Deno.

bartlomieju added a commit that referenced this issue May 16, 2024
Fixes #23761

Co-authored-by: Satya Rohith <me@satyarohith.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants