util: fix parseArgs skipping first positional arg with --eval= and --…#60814
Closed
azadgupta1 wants to merge 1 commit intonodejs:mainfrom
Closed
util: fix parseArgs skipping first positional arg with --eval= and --…#60814azadgupta1 wants to merge 1 commit intonodejs:mainfrom
azadgupta1 wants to merge 1 commit intonodejs:mainfrom
Conversation
IlyasShabi
reviewed
Nov 22, 2025
Renegade334
reviewed
Nov 22, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60814 +/- ##
==========================================
- Coverage 88.56% 88.53% -0.03%
==========================================
Files 703 703
Lines 208254 208425 +171
Branches 40156 40197 +41
==========================================
+ Hits 184430 184537 +107
- Misses 15828 15893 +65
+ Partials 7996 7995 -1
🚀 New features to boost your workflow:
|
bc85468 to
8ed13dc
Compare
IlyasShabi
reviewed
Nov 24, 2025
IlyasShabi
reviewed
Nov 24, 2025
Renegade334
requested changes
Nov 24, 2025
a89d8c5 to
5919b08
Compare
Renegade334
reviewed
Nov 25, 2025
5919b08 to
edb11e6
Compare
Contributor
Author
|
Thanks for the guidance, appreciate it! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
IlyasShabi
approved these changes
Dec 1, 2025
aduh95
reviewed
Dec 4, 2025
shadowspawn
reviewed
Dec 4, 2025
Member
|
Nice catch and change. I like checking the internal options instead of doing a pseudo parse of |
Contributor
Author
|
Just checking in — let me know if anything else is required from me. |
Member
|
There's #60814 (review) regarding the order of the test assertions, otherwise all good 👍 |
f1c2f16 to
20b7b6c
Compare
20b7b6c to
dc3236b
Compare
Renegade334
approved these changes
Dec 9, 2025
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Renegade334
pushed a commit
to Renegade334/node
that referenced
this pull request
Dec 11, 2025
PR-URL: nodejs#60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
Member
|
Landed in 060deae |
This was referenced Dec 11, 2025
Closed
aduh95
pushed a commit
that referenced
this pull request
Jan 9, 2026
PR-URL: #60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Jan 12, 2026
PR-URL: #60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
RafaelGSS
pushed a commit
that referenced
this pull request
Jan 13, 2026
PR-URL: #60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Jan 19, 2026
PR-URL: #60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
islandryu
pushed a commit
to islandryu/node
that referenced
this pull request
Jan 25, 2026
PR-URL: nodejs#60814 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
islandryu
pushed a commit
to islandryu/node
that referenced
this pull request
Jan 25, 2026
PR-URL: nodejs#61089 Refs: nodejs#60814 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: handle
--eval=and--print=correctly ingetMainArgs()Fixes #60808
parseArgs()was skipping the first positional argument when Node was startedwith
--eval=or--print=. The logic only checked for--eval/--printand missed the
--eval=.../--print=...forms.This patch adds
startsWith('--eval=')andstartsWith('--print=')checks sogetMainArgs()returns the correct slice ofprocess.argv.After this fix, positional arguments are preserved correctly for all eval/print forms.