-
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
src: add CheckOptions to Options classes #22943
Conversation
This commit adds a CheckOptions function that the options classes can optionally implement to check that options specified are correct (dependencies between options are met or options that are mutually exclusive). In the process of doing this the error pointer passed to Parse was changed to be of type vector so that potentially multiple options check failures can be reported.
src/node_options.cc
Outdated
#endif | ||
per_isolate->CheckOptions(errors); | ||
per_isolate->per_env->CheckOptions(errors); | ||
per_isolate->per_env->debug_options->CheckOptions(errors); |
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.
Would it maybe make sense to nest these directly, like callling debug_options->CheckOptions(errors)
from EnvironmentOptions::CheckOptions()
and so on?
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.
Ah I like that, I'll give that a try. Thanks
Re-run CI after latest commit: https://ci.nodejs.org/job/node-test-pull-request/17350/ |
Landed in 36bdd19, thanks for doing this! |
This commit adds a CheckOptions function that the options classes can optionally implement to check that options specified are correct (dependencies between options are met or options that are mutually exclusive). In the process of doing this the error pointer passed to Parse was changed to be of type vector so that potentially multiple options check failures can be reported. PR-URL: #22943 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit adds a CheckOptions function that the options classes can optionally implement to check that options specified are correct (dependencies between options are met or options that are mutually exclusive). In the process of doing this the error pointer passed to Parse was changed to be of type vector so that potentially multiple options check failures can be reported. PR-URL: #22943 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit adds a CheckOptions function that the options classes can
optionally implement to check that options specified are correct
(dependencies between options are met or options that are mutually
exclusive).
In the process of doing this the error pointer passed to Parse was
changed to be of type vector so that potentially multiple options check
failures can be reported.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes