Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 36 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisessrc: replace FromJust() with Check() when possible #27162
Conversation
nodejs-github-bot
added
C++
lib / src
labels
Apr 9, 2019
sam-github
requested review from
bnoordhuis and
addaleax
and removed request for
bnoordhuis
Apr 9, 2019
sam-github
force-pushed the
sam-github:check-instead-of-fromjust
branch
from
c223928
to
ae8393a
Apr 9, 2019
apapirovski
approved these changes
Apr 10, 2019
|
IMO a positive change. |
This comment has been minimized.
This comment has been minimized.
|
targos
approved these changes
Apr 10, 2019
sam-github
added some commits
Apr 9, 2019
sam-github
force-pushed the
sam-github:check-instead-of-fromjust
branch
from
ae8393a
to
f281035
Apr 11, 2019
This comment has been minimized.
This comment has been minimized.
devsnek
approved these changes
Apr 11, 2019
This comment has been minimized.
This comment has been minimized.
ZYSzys
approved these changes
Apr 12, 2019
ZYSzys
added
the
author ready
label
Apr 12, 2019
nodejs
deleted a comment from
nodejs-github-bot
Apr 12, 2019
This comment has been minimized.
This comment has been minimized.
|
Landed in 060d901 |
sam-github
closed this
Apr 12, 2019
sam-github
added a commit
that referenced
this pull request
Apr 12, 2019
sam-github
deleted the
sam-github:check-instead-of-fromjust
branch
Apr 12, 2019
This comment has been minimized.
This comment has been minimized.
|
Is it possible to make |
addaleax
added a commit
to addaleax/node
that referenced
this pull request
Apr 15, 2019
addaleax
referenced this pull request
Apr 15, 2019
Closed
worker: handle exception when creating execArgv errors #27245
addaleax
added a commit
that referenced
this pull request
Apr 17, 2019
beevelop
referenced this pull request
Apr 23, 2019
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs #302
This was referenced Apr 23, 2019
This comment has been minimized.
This comment has been minimized.
@sam-github You could file a V8 CL that does that. Seems like a good change to me. |
sam-github commentedApr 9, 2019
•
edited
FromJust() is often used not for its return value, but for its
side-effects. In these cases, Check() exists, and is more clear as to
the intent. From its comment:
To be used, where the actual value of the Maybe is not needed like
Object::Set.
See: https://github.com/nodejs/node/pull/26929/files#r269256335
I'm not dead sure this is a good idea, because Check() doesn't exist on 11.x, but on the other hand, it's
a trivial method, we could probably backport the v8 patch for it to 11.x if it's absence was painful.
Check()is much more clear in its intent, IMO, than FromJust() called just for its side-effect.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes