| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 95bbd0f commit 9d55a5e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -864,6 +864,19 @@ function update(url, params) { | |||
| 864 | 864 | ctx.search = '?' + serializedParams; | |
| 865 | 865 | } else { | |
| 866 | 866 | ctx.search = ''; | |
| 867 | + | ||
| 868 | + // Potentially strip trailing spaces from an opaque path | ||
| 869 | + if (ctx.hasOpaquePath && ctx.hash.length === 0) { | ||
| 870 | + let length = ctx.pathname.length; | ||
| 871 | + while (length > 0 && ctx.pathname.charCodeAt(length - 1) === 32) { | ||
| 872 | + length--; | ||
| 873 | + } | ||
| 874 | + | ||
| 875 | + // No need to copy the whole string if there is no space at the end | ||
| 876 | + if (length !== ctx.pathname.length) { | ||
| 877 | + ctx.pathname = ctx.pathname.slice(0, length); | ||
| 878 | + } | ||
| 879 | + } | ||
| 867 | 880 | } | |
| 868 | 881 | ctx.href = constructHref(ctx); | |
| 869 | 882 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,13 @@ | |||
| 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(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments