src: handle empty Maybe(Local) in node_util.cc#33867
src: handle empty Maybe(Local) in node_util.cc#33867addaleax wants to merge 3 commits intonodejs:masterfrom
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.
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 <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 8e12962 |
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33867 Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes