@@ -78,7 +78,7 @@ void BindingData::DomainToASCII(const FunctionCallbackInfo<Value>& args) {
7878
7979 std::string input = Utf8Value (env->isolate (), args[0 ]).ToString ();
8080 if (input.empty ()) {
81- return args.GetReturnValue ().Set (FIXED_ONE_BYTE_STRING (env->isolate (), " " ));
81+ return args.GetReturnValue ().Set (String::Empty (env->isolate ()));
8282 }
8383
8484 // It is important to have an initial value that contains a special scheme.
@@ -87,7 +87,7 @@ void BindingData::DomainToASCII(const FunctionCallbackInfo<Value>& args) {
8787 auto out = ada::parse<ada::url>(" ws://x" );
8888 DCHECK (out);
8989 if (!out->set_hostname (input)) {
90- return args.GetReturnValue ().Set (FIXED_ONE_BYTE_STRING (env->isolate (), " " ));
90+ return args.GetReturnValue ().Set (String::Empty (env->isolate ()));
9191 }
9292 std::string host = out->get_hostname ();
9393 args.GetReturnValue ().Set (
@@ -101,8 +101,7 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
101101
102102 std::string input = Utf8Value (env->isolate (), args[0 ]).ToString ();
103103 if (input.empty ()) {
104- return args.GetReturnValue ().Set (
105- String::NewFromUtf8 (env->isolate (), " " ).ToLocalChecked ());
104+ return args.GetReturnValue ().Set (String::Empty (env->isolate ()));
106105 }
107106
108107 // It is important to have an initial value that contains a special scheme.
@@ -111,8 +110,7 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
111110 auto out = ada::parse<ada::url>(" ws://x" );
112111 DCHECK (out);
113112 if (!out->set_hostname (input)) {
114- return args.GetReturnValue ().Set (
115- String::NewFromUtf8 (env->isolate (), " " ).ToLocalChecked ());
113+ return args.GetReturnValue ().Set (String::Empty (env->isolate ()));
116114 }
117115 std::string result = ada::unicode::to_unicode (out->get_hostname ());
118116
0 commit comments