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

src: add CheckOptions to Options classes #22943

Closed
wants to merge 2 commits into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Sep 19, 2018

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

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.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 19, 2018
@danbev
Copy link
Contributor Author

danbev commented Sep 19, 2018

#endif
per_isolate->CheckOptions(errors);
per_isolate->per_env->CheckOptions(errors);
per_isolate->per_env->debug_options->CheckOptions(errors);
Copy link
Member

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?

Copy link
Contributor Author

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

@danbev
Copy link
Contributor Author

danbev commented Sep 21, 2018

Re-run CI after latest commit: https://ci.nodejs.org/job/node-test-pull-request/17350/

@addaleax
Copy link
Member

Landed in 36bdd19, thanks for doing this!

@addaleax addaleax closed this Sep 22, 2018
addaleax pushed a commit that referenced this pull request Sep 22, 2018
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>
targos pushed a commit that referenced this pull request Sep 23, 2018
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>
@danbev danbev deleted the check_options branch August 20, 2019 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants