-
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
src: add a condition if the argument of DomainToUnicode
is empty
#49097
Conversation
Review requested:
|
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.
What's the goal of this pull request? Can you provide an example and update your PR with a test?
@anonrig Thank you for your comments.
|
@pluris It already returns an empty string when an empty string is passed. It seems like this is an optimization for performance for the empty input to perform faster.
|
return args.GetReturnValue().Set( | ||
String::NewFromUtf8(env->isolate(), "").ToLocalChecked()); |
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.
return args.GetReturnValue().Set( | |
String::NewFromUtf8(env->isolate(), "").ToLocalChecked()); | |
return args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING(env->isolate(), "")); |
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.
Can you apply the changes?
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.
@anonrig Oh, I'm so sorry. I checked this comment too late. I thought I fixed it, but maybe I didn't add a commit...
It seems that the PR has been merged, but I will fix it.
@pluris I don't think removing it would make a difference since it is a single branch (in c++). So, personally I'm fine with adding it to |
@anonrig Thank you for your opinion. It helped me a lot. 😄 |
@pluris Can you rebase from |
e2fd13c
to
4e380fd
Compare
@anonrig Yes, I did rebase and force-push. |
4e380fd
to
adf338b
Compare
Landed in 45e5ec8 |
PR-URL: nodejs#49336 Refs: nodejs#49097 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
PR-URL: nodejs/node#49097 Refs: nodejs/node#46410 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
PR-URL: nodejs/node#49097 Refs: nodejs/node#46410 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Add an empty check for the input, like
DomainToASCII
in the line below.node/src/node_url.cc
Lines 79 to 82 in f1b3ade
Refs : #46410