summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/js/lib.deno.shared_globals.d.ts2
-rw-r--r--std/path/posix.ts2
-rw-r--r--std/path/win32.ts2
3 files changed, 3 insertions, 3 deletions
diff --git a/cli/js/lib.deno.shared_globals.d.ts b/cli/js/lib.deno.shared_globals.d.ts
index ed1c1ac0b..9ad9f0a1e 100644
--- a/cli/js/lib.deno.shared_globals.d.ts
+++ b/cli/js/lib.deno.shared_globals.d.ts
@@ -1172,7 +1172,7 @@ interface URL {
declare const URL: {
prototype: URL;
- new (url: string | URL, base?: string | URL): URL;
+ new (url: string, base?: string | URL): URL;
createObjectURL(object: any): string;
revokeObjectURL(url: string): void;
};
diff --git a/std/path/posix.ts b/std/path/posix.ts
index e88eb3f97..981d32a8c 100644
--- a/std/path/posix.ts
+++ b/std/path/posix.ts
@@ -430,5 +430,5 @@ export function parse(path: string): ParsedPath {
* are ignored.
*/
export function fromFileUrl(url: string | URL): string {
- return new URL(url).pathname;
+ return new URL(url.toString()).pathname;
}
diff --git a/std/path/win32.ts b/std/path/win32.ts
index 0557b3768..eafddd138 100644
--- a/std/path/win32.ts
+++ b/std/path/win32.ts
@@ -908,7 +908,7 @@ export function parse(path: string): ParsedPath {
* are ignored.
*/
export function fromFileUrl(url: string | URL): string {
- return new URL(url).pathname
+ return new URL(url.toString()).pathname
.replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
.replace(/\//g, "\\");
}