Skip to content

Commit

Permalink
src: use ToV8Value where more convenient in node_url_pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Feb 1, 2025
1 parent d15c43b commit 2c24d77
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/node_url_pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,8 @@ MaybeLocal<Object> URLPattern::URLPatternComponentResult::ToJSObject(
auto context = env->context();
auto parsed_group = Object::New(isolate);
for (const auto& [group_key, group_value] : result.groups) {
Local<String> key;
if (!String::NewFromUtf8(isolate,
group_key.c_str(),
NewStringType::kNormal,
group_key.size())
.ToLocal(&key)) {
Local<Value> key;
if (!ToV8Value(context, group_key).ToLocal(&key)) {
return {};
}
Local<Value> value;
Expand Down

0 comments on commit 2c24d77

Please sign in to comment.