-
Notifications
You must be signed in to change notification settings - Fork 30k
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: handle empty Maybe(Local) in node_util.cc #33867
Conversation
if (!args[1]->Uint32Value(env->context()).To(&index)) return; | ||
Local<Private> private_symbol = IndexToPrivateSymbol(env, index); | ||
Local<Value> ret; | ||
if (obj->GetPrivate(env->context(), private_symbol).ToLocal(&ret)) |
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'm not 100% sure but I don't think GetPrivate()
can actually fail provided that obj->IsObject()
.
@bnoordhuis The point isn’t so much as to whether these ops can currently fail or not, it’s more that I want to move more of our code into a state where it is “obviously not broken”, and be consistent about that. At least the |
We'll have to disagree on what "obviously not broken" means. Replacing Point ceded on the (You can probably trigger it if you go out of your way to poison the runtime but normally I would expect it to be a bug on our side.) |
Like a lot of operations, it fails when JS execution is being terminated. That’s one of the main points here – it is only obvious that |
If My point about changing the CHECK remains though: it serves no point that I can see. |
Because I thought it was obvious, sorry. I’ll add
Okay, since you feel strongly about it, I’ve restored it, and switched to the variant that we use when we |
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 8e12962 |
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes