File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -230,11 +230,13 @@ impl<'a> ConstructorStringParser<'a> {
230
230
assert ! ( self . token_index < self . token_list. len( ) ) ;
231
231
let token = & self . token_list [ self . token_index ] ;
232
232
let component_start_index = self . get_safe_token ( self . component_start ) . index ;
233
+
233
234
self
234
235
. input
235
- . get ( component_start_index..token. index ) // TODO: check & codepoint
236
- . unwrap ( )
237
- . to_string ( )
236
+ . chars ( )
237
+ . skip ( component_start_index)
238
+ . take ( token. index - component_start_index)
239
+ . collect ( )
238
240
}
239
241
240
242
// Ref: https://wicg.github.io/urlpattern/#rewind-and-set-state
Original file line number Diff line number Diff line change @@ -954,6 +954,15 @@ mod tests {
954
954
. unwrap ( ) ;
955
955
}
956
956
957
+ #[ test]
958
+ fn issue46 ( ) {
959
+ quirks:: process_construct_pattern_input (
960
+ quirks:: StringOrInit :: String ( ":café://:foo" . to_owned ( ) ) ,
961
+ None ,
962
+ )
963
+ . unwrap ( ) ;
964
+ }
965
+
957
966
#[ test]
958
967
fn has_regexp_group ( ) {
959
968
let pattern = <UrlPattern >:: parse ( UrlPatternInit {
You can’t perform that action at this time.
0 commit comments