We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DomainToUnicode
1 parent c021b27 commit adf338bCopy full SHA for adf338b
src/node_url.cc
@@ -100,6 +100,11 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
100
CHECK(args[0]->IsString());
101
102
std::string input = Utf8Value(env->isolate(), args[0]).ToString();
103
+ if (input.empty()) {
104
+ return args.GetReturnValue().Set(
105
+ String::NewFromUtf8(env->isolate(), "").ToLocalChecked());
106
+ }
107
+
108
// It is important to have an initial value that contains a special scheme.
109
// Since it will change the implementation of `set_hostname` according to URL
110
// spec.
0 commit comments