summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/lib.deno.shared_globals.d.ts2
-rw-r--r--cli/js/web/url.ts4
2 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 ef870d2aa..635fa391e 100644
--- a/cli/js/lib.deno.shared_globals.d.ts
+++ b/cli/js/lib.deno.shared_globals.d.ts
@@ -1092,7 +1092,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;
};
diff --git a/cli/js/web/url.ts b/cli/js/web/url.ts
index 6a8dc6627..3d513a010 100644
--- a/cli/js/web/url.ts
+++ b/cli/js/web/url.ts
@@ -356,7 +356,7 @@ export class URLImpl implements URL {
return this.#searchParams;
}
- constructor(url: string, base?: string | URL) {
+ constructor(url: string | URL, base?: string | URL) {
let baseParts: URLParts | undefined;
if (base) {
baseParts = typeof base === "string" ? parse(base) : parts.get(base);
@@ -365,7 +365,7 @@ export class URLImpl implements URL {
}
}
- const urlParts = parse(url);
+ const urlParts = typeof url === "string" ? parse(url) : parts.get(url);
if (!urlParts) {
throw new TypeError("Invalid URL.");
}