-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Conversation
ddcbf1b
to
1fa8286
Compare
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
This commit adds:
addAbortListener
innode:events
(fixes error: Uncaught SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener' #25402)aborted
innode:util
(towards ext/node: missing node:util APIs #21378)execPath
andexecvArgs
named export fromnode:process
getDefaultHighWaterMark
fromnode:stream
The
execPath
is very hacky - because module namespaces can not have real getters,execPath
is an object with atoString()
method that on call returns the actualexecPath
, and replaces theexecPath
binding with the string. This is done so that we don't require theexecPath
permission on startup.