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 9e1c531 commit 8c33731Copy full SHA for 8c33731
src/node_url.cc
@@ -95,6 +95,11 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
95
CHECK(args[0]->IsString());
96
97
std::string input = Utf8Value(env->isolate(), args[0]).ToString();
98
+ if (input.empty()) {
99
+ return args.GetReturnValue().Set(
100
+ String::NewFromUtf8(env->isolate(), "").ToLocalChecked());
101
+ }
102
+
103
// It is important to have an initial value that contains a special scheme.
104
// Since it will change the implementation of `set_hostname` according to URL
105
// spec.
0 commit comments