-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <webmaster@geoffreybooth.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #35098 (comment) PR-URL: #35106 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Fixes: nodejs#35095 PR-URL: nodejs#35098 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refs: nodejs#35098 (comment) PR-URL: nodejs#35106 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Fixes: #35095
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes