-
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: use better return types in KVStore #54539
Conversation
- Use `v8::Maybe<void>` instead of `v8::Maybe<bool>` and handle error from `AssignFromObject`. - An empty `v8::Maybe` is supposed to be returned when an exception is pending. Use `std::optional` instead to indicate a missing value in `Get(key)`.
Note that I didn't change |
/cc @nodejs/cpp-reviewers |
This comment was marked as resolved.
This comment was marked as resolved.
The mistake was obvious. |
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54539 +/- ##
=======================================
Coverage 87.32% 87.33%
=======================================
Files 649 649
Lines 182603 182607 +4
Branches 35042 35042
=======================================
+ Hits 159464 159471 +7
+ Misses 16400 16397 -3
Partials 6739 6739
|
Commit Queue failed- Loading data for nodejs/node/pull/54539 ✔ Done loading data for nodejs/node/pull/54539 ----------------------------------- PR info ------------------------------------ Title src: use better return types in KVStore (#54539) Author Michaël Zasso <targos@protonmail.com> (@targos) Branch targos:kv-optional -> nodejs:main Labels c++, lib / src, needs-ci, commit-queue-squash Commits 2 - src: use better return types in KVStore - fixup Committers 1 - Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 24 Aug 2024 13:14:22 GMT ✔ Approvals: 5 ✔ - Tobias Nießen (@tniessen) (TSC): https://github.com/nodejs/node/pull/54539#pullrequestreview-2258733830 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/54539#pullrequestreview-2258750609 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/54539#pullrequestreview-2258973417 ✔ - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/54539#pullrequestreview-2258999489 ✔ - Mohammed Keyvanzadeh (@VoltrexKeyva): https://github.com/nodejs/node/pull/54539#pullrequestreview-2259303546 ✘ Last GitHub CI failed ℹ Last Full PR CI on 2024-08-24T21:03:59Z: https://ci.nodejs.org/job/node-test-pull-request/61426/ - Querying data for job/node-test-pull-request/61426/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/10560540424 |
- Use `v8::Maybe<void>` instead of `v8::Maybe<bool>` and handle error from `AssignFromObject`. - An empty `v8::Maybe` is supposed to be returned when an exception is pending. Use `std::optional` instead to indicate a missing value in `Get(key)`. PR-URL: #54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Landed in 8f1fa03 |
- Use `v8::Maybe<void>` instead of `v8::Maybe<bool>` and handle error from `AssignFromObject`. - An empty `v8::Maybe` is supposed to be returned when an exception is pending. Use `std::optional` instead to indicate a missing value in `Get(key)`. PR-URL: #54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
- Use `v8::Maybe<void>` instead of `v8::Maybe<bool>` and handle error from `AssignFromObject`. - An empty `v8::Maybe` is supposed to be returned when an exception is pending. Use `std::optional` instead to indicate a missing value in `Get(key)`. PR-URL: #54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
- Use `v8::Maybe<void>` instead of `v8::Maybe<bool>` and handle error from `AssignFromObject`. - An empty `v8::Maybe` is supposed to be returned when an exception is pending. Use `std::optional` instead to indicate a missing value in `Get(key)`. PR-URL: nodejs#54539 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
v8::Maybe<void>
instead ofv8::Maybe<bool>
and handle errorfrom
AssignFromObject
.v8::Maybe
is supposed to be returned when an exception ispending. Use
std::optional
instead to indicate a missing value inGet(key)
.