Skip to content

Commit 00f904f

Browse files
committed
src: use ToV8Value where more convenient in node_url_pattern
1 parent 5ed8d3d commit 00f904f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/node_url_pattern.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,8 @@ MaybeLocal<Object> URLPattern::URLPatternComponentResult::ToJSObject(
367367
auto context = env->context();
368368
auto parsed_group = Object::New(isolate);
369369
for (const auto& [group_key, group_value] : result.groups) {
370-
Local<String> key;
371-
if (!String::NewFromUtf8(isolate,
372-
group_key.c_str(),
373-
NewStringType::kNormal,
374-
group_key.size())
375-
.ToLocal(&key)) {
370+
Local<Value> key;
371+
if (!ToV8Value(context, group_key).ToLocal(&key)) {
376372
return {};
377373
}
378374
Local<Value> value;

0 commit comments

Comments
 (0)