-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix url_pattern_component constructor
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/include/ada/url_pattern-inl.h b/include/ada/url_pattern-inl.h | ||
index c7c04a06..6da583e9 100644 | ||
--- a/include/ada/url_pattern-inl.h | ||
+++ b/include/ada/url_pattern-inl.h | ||
@@ -41,7 +41,7 @@ url_pattern_component::create_component_match_result( | ||
// Let value be Get(execResult, ToString(index)). | ||
// Set groups[name] to value. | ||
result.groups.insert({ | ||
- group_name_list[index - 1], | ||
+ "", | ||
exec_result[index].str(), | ||
}); | ||
} | ||
diff --git a/include/ada/url_pattern.h b/include/ada/url_pattern.h | ||
index 13466dd6..7aa41a57 100644 | ||
--- a/include/ada/url_pattern.h | ||
+++ b/include/ada/url_pattern.h | ||
@@ -203,9 +203,8 @@ class url_pattern_component { | ||
std::vector<std::string>&& new_group_name_list, | ||
bool new_has_regexp_groups) | ||
: regexp(new_regexp), | ||
- pattern(std::move(new_pattern)), | ||
+ pattern(new_pattern), | ||
flags(new_flags), | ||
- group_name_list(new_group_name_list), | ||
has_regexp_groups(new_has_regexp_groups) {} | ||
|
||
// @see https://urlpattern.spec.whatwg.org/#compile-a-component | ||
@@ -223,7 +222,6 @@ class url_pattern_component { | ||
std::regex regexp{}; | ||
std::string pattern{}; | ||
std::regex_constants::syntax_option_type flags = std::regex::ECMAScript; | ||
- std::vector<std::string> group_name_list{}; | ||
bool has_regexp_groups = false; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters