File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -872,6 +872,19 @@ function update(url, params) {
872
872
ctx . search = '?' + serializedParams ;
873
873
} else {
874
874
ctx . search = '' ;
875
+
876
+ // Potentially strip trailing spaces from an opaque path
877
+ if ( ctx . hasOpaquePath && ctx . hash . length === 0 ) {
878
+ let length = ctx . pathname . length ;
879
+ while ( length > 0 && ctx . pathname . charCodeAt ( length - 1 ) === 32 ) {
880
+ length -- ;
881
+ }
882
+
883
+ // No need to copy the whole string if there is no space at the end
884
+ if ( length !== ctx . pathname . length ) {
885
+ ctx . pathname = ctx . pathname . slice ( 0 , length ) ;
886
+ }
887
+ }
875
888
}
876
889
ctx . href = constructHref ( ctx ) ;
877
890
}
Original file line number Diff line number Diff line change 7
7
"skip" : " TODO: port from .window.js"
8
8
},
9
9
"historical.any.js" : {
10
- "requires" : [" small-icu" ]
10
+ "requires" : [" small-icu" ],
11
+ "fail" : {
12
+ "expected" : [
13
+ " URL: no structured serialize/deserialize support" ,
14
+ " URLSearchParams: no structured serialize/deserialize support"
15
+ ]
16
+ }
11
17
},
12
18
"urlencoded-parser.any.js" : {
13
19
"requires" : [" small-icu" ]
Original file line number Diff line number Diff line change @@ -15,6 +15,6 @@ runner.setScriptModifier((obj) => {
15
15
} ) ;
16
16
runner . pretendGlobalThisAs ( 'Window' ) ;
17
17
runner . setInitScript ( `
18
- globalThis.location = {};
18
+ globalThis.location || = {};
19
19
` ) ;
20
20
runner . runJsTests ( ) ;
You can’t perform that action at this time.
0 commit comments