-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
module: fix specifier resolution option value #35098
Conversation
Review requested:
|
The two flags are already set up as aliases in the options parser FWIW https://github.com/nodejs/node/blob/master/src/node_options.cc#L95-L114 https://github.com/nodejs/node/blob/master/src/node_options.cc#L366-L374 |
Yep, so I found what the actually bug is, Line 101 in ccdd1bd
assign |
Why is |
@addaleax I think I set it up this way to ensure that both aliases were not used at the same time, which may have been a bit of overengineering. We could likely simplify the logic or simply remove the alias on master / 15 tbh |
@MylesBorins Yeah, I think that’s something we should definitely simplify. Having it be a plain alias turns it into a single line with basically 0 maintenance overhead (which can and should be kept indefinitely according to our policies). @himself65 Do you want to turn |
@addaleax would a simple alias fail if both the original and alias are passed with different values? |
@MylesBorins No, but if necessary we could make that happen. However, I don’t think it’s worth all the complexity of this code. |
@addaleax SGTM. |
Do we have a documented priority of the option value if 2 conflicting values are supplied? |
The last specified value is used. This is just like when an option that has a single value is used twice. |
@addaleax any behavior seems fine, just want docs. |
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.
Thank you :)
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.
LGTM
Landed in 22c52aa |
Fixes: nodejs#35095 PR-URL: nodejs#35098 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Fixes: #35095 PR-URL: #35098 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Fixes: #35095 PR-URL: #35098 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Fixes: #35095 PR-URL: #35098 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Fixes: nodejs#35095 PR-URL: nodejs#35098 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Refs: nodejs#35098 (comment) PR-URL: nodejs#35106 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Fixes: #35095
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes