Tags: NativeScript/ios
Tags
fix(urlpattern): match capture groups in test()/exec() (#402) v8_regex_provider::regex_search had two bugs that made URLPattern matching fail (or crash) for any pattern with capture groups: - The ToLocal(&item) success check was inverted, so the first successfully read match element bailed out as "no match" and test()/exec() always returned false/null. - It included match element 0 (the whole-match string). ada's create_component_match_result pairs exec_result[i] with group_name_list[i] and expects only the capture groups, so the extra element overran group_name_list and crashed once the inverted check was fixed. Iterate from index 1 and bail only when reading an element fails. Add URLPattern regression tests covering test() match/non-match and exec() named capture-group extraction and null-on-no-match.
PreviousNext