-
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
src: merge ToJsSet into ToV8Value #41757
Conversation
This addresses a `TODO` comment, and makes use of the opportunity to also clean up our `MaybeLocal` handling in this area and start accepting `std::string_view` where we accept `std::string`.
Review requested:
|
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 with one tiny style nit, feel free to ignore.
if (!ToV8Value(context, env->native_modules_with_cache) | ||
.ToLocal(&native_modules_with_cache_js)) { |
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.
Not sure if allowed by the linter, but the .
should not align with the !
IMO.
if (!ToV8Value(context, env->native_modules_with_cache) | |
.ToLocal(&native_modules_with_cache_js)) { | |
if (!ToV8Value(context, env->native_modules_with_cache) | |
.ToLocal(&native_modules_with_cache_js)) { |
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.
Not sure if allowed by the linter
The c++ linter doesn't care about indentations for now.
but the
.
should not align with the!
IMO.
That would be 5 spaces instead of what's suggested in the style guide, i.e., 4 - https://github.com/nodejs/node/blob/HEAD/doc/contributing/cpp-style-guide.md#4-spaces-of-indentation-for-statement-continuations. Should the doc be updated with more info about this special case?
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.
I think we’re following the 4-spaces rule pretty universally, and I wouldn’t change these kinds of cases to be special in that regard.
if (!ToV8Value(context, env->native_modules_without_cache) | ||
.ToLocal(&native_modules_without_cache_js)) { |
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.
if (!ToV8Value(context, env->native_modules_without_cache) | |
.ToLocal(&native_modules_without_cache_js)) { | |
if (!ToV8Value(context, env->native_modules_without_cache) | |
.ToLocal(&native_modules_without_cache_js)) { |
if (!ToV8Value(context, env->native_modules_in_snapshot) | ||
.ToLocal(&native_modules_without_cache_js)) { |
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.
if (!ToV8Value(context, env->native_modules_in_snapshot) | |
.ToLocal(&native_modules_without_cache_js)) { | |
if (!ToV8Value(context, env->native_modules_in_snapshot) | |
.ToLocal(&native_modules_without_cache_js)) { |
Commit Queue failed- Loading data for nodejs/node/pull/41757 ✔ Done loading data for nodejs/node/pull/41757 ----------------------------------- PR info ------------------------------------ Title src: merge ToJsSet into ToV8Value (#41757) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch addaleax:tovalue-set -> nodejs:master Labels c++, author ready, dont-land-on-v12.x, dont-land-on-v14.x, dont-land-on-v16.x Commits 2 - src: merge ToJsSet into ToV8Value - fixup! src: merge ToJsSet into ToV8Value Committers 1 - Anna Henningsen PR-URL: https://github.com/nodejs/node/pull/41757 Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Tobias Nießen ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41757 Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Tobias Nießen -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 29 Jan 2022 20:41:48 GMT ✔ Approvals: 3 ✔ - Darshan Sen (@RaisinTen) (TSC): https://github.com/nodejs/node/pull/41757#pullrequestreview-868068814 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/41757#pullrequestreview-868352075 ✔ - Tobias Nießen (@tniessen) (TSC): https://github.com/nodejs/node/pull/41757#pullrequestreview-874028296 ✖ GitHub CI is still running ℹ Last Full PR CI on 2022-02-07T18:04:12Z: https://ci.nodejs.org/job/node-test-pull-request/42424/ - Querying data for job/node-test-pull-request/42424/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1829075152 |
Landed in 34be1af |
This addresses a `TODO` comment, and makes use of the opportunity to also clean up our `MaybeLocal` handling in this area and start accepting `std::string_view` where we accept `std::string`. PR-URL: nodejs#41757 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
This addresses a `TODO` comment, and makes use of the opportunity to also clean up our `MaybeLocal` handling in this area and start accepting `std::string_view` where we accept `std::string`. PR-URL: nodejs#41757 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
This addresses a `TODO` comment, and makes use of the opportunity to also clean up our `MaybeLocal` handling in this area and start accepting `std::string_view` where we accept `std::string`. PR-URL: #41757 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
This addresses a
TODO
comment, and makes use of the opportunityto also clean up our
MaybeLocal
handling in this area andstart accepting
std::string_view
where we acceptstd::string
.