-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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: improve error handling in process.env handling #57707
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
0171633
to
1e109eb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@@ -421,6 +440,7 @@ static Intercepted EnvGetter(Local<Name> property, | |||
TraceEnvVar(env, "get", property.As<String>()); | |||
|
|||
if (has_env) { | |||
// ToLocalChecked here is ok since we check IsEmpty above. |
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.
Wouldn't it be worth refactoring to use ToLocal
instead? (to clarify, I'm not asking you to do it, I'm curious is all, and I get that the current code would not crash as is, but might still be a good idea to refactor this for consistency sake)
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.
Possibly? Not that critical tho.
PR-URL: #57707 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Landed in 214e3d4 |
Improve error handling by eliminating ToLocalChecked uses