1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

Revert "Fix definition of URL constructor (#5521)" (#5564)

This reverts commit 63bc468365.
This commit is contained in:
Ryan Dahl 2020-05-18 08:46:56 -04:00 committed by GitHub
parent f6caf4883d
commit 2a038eafcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -1172,7 +1172,7 @@ interface URL {
declare const URL: {
prototype: URL;
new (url: string, base?: string | URL): URL;
new (url: string | URL, base?: string | URL): URL;
createObjectURL(object: any): string;
revokeObjectURL(url: string): void;
};

View file

@ -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;
}

View file

@ -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, "\\");
}