From 2a038eafcd1bd715f865e3b4642575af05893dc5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 18 May 2020 08:46:56 -0400 Subject: Revert "Fix definition of URL constructor (#5521)" (#5564) This reverts commit 63bc468365bceda929a39b5eb93b605e2dc2bd9c. --- std/path/posix.ts | 2 +- std/path/win32.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'std/path') diff --git a/std/path/posix.ts b/std/path/posix.ts index 981d32a8c..e88eb3f97 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.toString()).pathname; + return new URL(url).pathname; } diff --git a/std/path/win32.ts b/std/path/win32.ts index eafddd138..0557b3768 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.toString()).pathname + return new URL(url).pathname .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/") .replace(/\//g, "\\"); } -- cgit v1.2.3