src: add a condition if the argument of DomainToUnicode is empty#49097
src: add a condition if the argument of DomainToUnicode is empty#49097nodejs-github-bot merged 1 commit intonodejs:mainfrom
DomainToUnicode is empty#49097Conversation
|
Review requested:
|
anonrig
left a comment
There was a problem hiding this comment.
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.
| 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.
@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
DomainToASCIIin the line below.node/src/node_url.cc
Lines 79 to 82 in f1b3ade
Refs : #46410