File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ license = "MIT"
1111url = " 2.5.6"
1212regex = " 1.10.5"
1313serde = { version = " 1.0.127" , features = [" derive" ] }
14- unic-ucd-ident = { version = " 0.9.0 " , features = [ " id " ] }
14+ icu_properties = " 2 "
1515
1616[dev-dependencies ]
1717serde_json = " 1.0.66"
Original file line number Diff line number Diff line change @@ -1063,6 +1063,22 @@ mod tests {
10631063 assert ! ( pattern. has_regexp_groups( ) ) ;
10641064 }
10651065
1066+ #[ test]
1067+ fn issue54 ( ) {
1068+ let pattern = <UrlPattern >:: parse (
1069+ UrlPatternInit {
1070+ pathname : Some ( "/:thereisa\u{30FB} middledot." . to_owned ( ) ) ,
1071+ ..Default :: default ( )
1072+ } ,
1073+ Default :: default ( ) ,
1074+ )
1075+ . unwrap ( ) ;
1076+ assert_eq ! (
1077+ pattern. pathname. group_name_list,
1078+ vec![ "thereisa\u{30FB} middledot" ]
1079+ ) ;
1080+ }
1081+
10661082 #[ test]
10671083 fn issue61 ( ) {
10681084 // Test case for https://github.com/denoland/deno/issues/29935
Original file line number Diff line number Diff line change 22
33use crate :: error:: TokenizerError ;
44use crate :: Error ;
5+ use icu_properties:: {
6+ props:: { IdContinue , IdStart } ,
7+ CodePointSetDataBorrowed ,
8+ } ;
59
610// Ref: https://wicg.github.io/urlpattern/#tokens
711// Ref: https://wicg.github.io/urlpattern/#tokenizing
@@ -323,13 +327,18 @@ pub fn tokenize(
323327 Ok ( tokenizer. token_list )
324328}
325329
330+ static ID_START : CodePointSetDataBorrowed < ' _ > =
331+ CodePointSetDataBorrowed :: new :: < IdStart > ( ) ;
332+ static ID_CONTINUE : CodePointSetDataBorrowed < ' _ > =
333+ CodePointSetDataBorrowed :: new :: < IdContinue > ( ) ;
334+
326335// Ref: https://wicg.github.io/urlpattern/#is-a-valid-name-code-point
327336#[ inline]
328337pub ( crate ) fn is_valid_name_codepoint ( code_point : char , first : bool ) -> bool {
329338 if first {
330- unic_ucd_ident :: is_id_start ( code_point) || matches ! ( code_point, '$' | '_' )
339+ ID_START . contains ( code_point) || matches ! ( code_point, '$' | '_' )
331340 } else {
332- unic_ucd_ident :: is_id_continue ( code_point)
341+ ID_CONTINUE . contains ( code_point)
333342 || matches ! ( code_point, '$' | '\u{200C}' | '\u{200D}' )
334343 }
335344}
You can’t perform that action at this time.
0 commit comments