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:
|
tniessen
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
| 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.
| 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 <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
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 <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
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 <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This addresses a
TODOcomment, and makes use of the opportunityto also clean up our
MaybeLocalhandling in this area andstart accepting
std::string_viewwhere we acceptstd::string.