summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-08-29 09:12:10 +0100
committerGitHub <noreply@github.com>2020-08-29 10:12:10 +0200
commitd6dc797d155d85bbe8011b2f58c9b66267d557dd (patch)
tree470136fde6723cd9c7d855777a0266cf3fcb8f49
parent84086e7d3274fd46eace4a9131cda9eda1d76907 (diff)
fix(URL): Add missing part assignment (#7239)
-rw-r--r--cli/rt/11_url.js1
-rw-r--r--cli/tests/unit/url_test.ts2
2 files changed, 3 insertions, 0 deletions
diff --git a/cli/rt/11_url.js b/cli/rt/11_url.js
index 7e01f4d88..5de6cc8c7 100644
--- a/cli/rt/11_url.js
+++ b/cli/rt/11_url.js
@@ -339,6 +339,7 @@
}
usedNonBase = true;
} else {
+ parts.slashes = baseParts.slashes;
parts.username = baseParts.username;
parts.password = baseParts.password;
parts.hostname = baseParts.hostname;
diff --git a/cli/tests/unit/url_test.ts b/cli/tests/unit/url_test.ts
index e71f07036..bf367df76 100644
--- a/cli/tests/unit/url_test.ts
+++ b/cli/tests/unit/url_test.ts
@@ -342,6 +342,8 @@ unitTest(function urlBase(): void {
assertEquals(new URL("efgh:", "http://foo/a/b?c#d").href, "efgh:");
assertEquals(new URL("efgh:", "file://foo/a/b?c#d").href, "efgh:");
assertEquals(new URL("efgh:", "abcd://foo/a/b?c#d").href, "efgh:");
+
+ assertEquals(new URL("/foo", "abcd:/").href, "abcd:/foo");
});
unitTest(function urlDriveLetterBase() {