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

feat(ext/node): add abort helpers, process & streams fix #25262

Merged
merged 5 commits into from
Sep 5, 2024

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Aug 28, 2024

This commit adds:

The execPath is very hacky - because module namespaces can not have real getters, execPath is an object with a toString() method that on call returns the actual execPath, and replaces the execPath binding with the string. This is done so that we don't require the execPath permission on startup.

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks great! Only thing missing now are tests.

This commit adds:

- `addAbortListener` in `node:events`
- `aborted` in `node:util`
- `execPath` and `execvArgs` named export from `node:process`
- `getDefaultHighWaterMark` from `node:stream`

The `execPath` is very hacky - because module namespaces can not have real getters, `execPath` is an object with a `toString()` method that on call returns the actual `execPath`, and replaces the `execPath` binding with the string. This is done so that we don't require the `execPath` permission on startup.
export let execPath: string = Object.freeze({
__proto__: String.prototype,
toString() {
execPath = Deno.execPath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could happen during the bootstrap process when we're not warming up? Then we won't have to call it each time execPath is accessed?

@lucacasonato lucacasonato merged commit 49e3ee0 into denoland:main Sep 5, 2024
17 checks passed
@lucacasonato lucacasonato deleted the fixes branch September 5, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants