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

fix(ext/node): Support returning tokens and option defaults in node:util.parseArgs #23192

Merged
merged 3 commits into from Apr 2, 2024

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented Apr 2, 2024

Fixes #23179.
Fixes #22454.

Enables passing {tokens: true} to parseArgs and setting default values for options.

With this PR, the observable framework works with deno out of the box (no unstable flags needed).

The existing code was basically copied straight from node, so this PR mostly just updates that (out of date) vendored code. Also fixes some issues with error exports (before this PR, in certain error cases we were attempting to construct error classes that weren't actually in scope).

The last change (in the second commit) adds a small hack so that we actually exercise the test-parse-args.js node_compat test, previously it was reported as passing though it should have failed. That test now passes.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM!

@nathanwhit nathanwhit merged commit 219a27d into denoland:main Apr 2, 2024
17 checks passed
satyarohith pushed a commit that referenced this pull request Apr 11, 2024
…util.parseArgs` (#23192)

Fixes #23179.
Fixes #22454.

Enables passing `{tokens: true}` to `parseArgs` and setting default
values for options.

With this PR, the observable framework works with deno out of the box
(no unstable flags needed).

The existing code was basically copied straight from node, so this PR
mostly just updates that (out of date) vendored code. Also fixes some
issues with error exports (before this PR, in certain error cases we
were attempting to construct error classes that weren't actually in
scope).

The last change (in the second commit) adds a small hack so that we
actually exercise the `test-parse-args.js` node_compat test, previously
it was reported as passing though it should have failed. That test now
passes.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parseArgs from node:util doesn't support tokens node compat: parseArgs doesn't support default option
2 participants