-
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
quic: use Check instead of FromJust in node_quic.cc #33937
Conversation
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.
LGTM
@danbev Since you’re opening quite a few PRs of that kind … would you be interested in helping us move away from .Check()
/.FromJust()
/.ToLocalChecked()
in places where those calls aren’t valid? So far I’ve mostly been trying to avoid that new code uses those inaccurately, but it would of course be nice to also make this work for code like this, where neither .FromJust()
nor .Check()
are really correct :)
I'd be happy to. Could you give me an example of where these calls are not valid so I understand the reason for them not being valid? |
@danbev I think the description in https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion might be helpful? The tl;dr is that anything that potentially runs JS code, including built-in V8 JS code or getters/setters on built-in object’s prototypes, can fail and thus result in a crash. For example, in this particular case: $ node -e 'Object.defineProperty(Object.prototype, "sessionConfig", {set() { throw new Error(); }}); net.createQuicSocket()'
FATAL ERROR: v8::FromJust Maybe value is Nothing.
[...] (I know that these |
Re-run of failing node-test-commit-arm-fanned ✔️ |
@addaleax Thanks, I'll try to take a closer look this week. |
PR-URL: #33937 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Landed in 013cd1a. |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes