summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/util.ts7
1 files changed, 1 insertions, 6 deletions
diff --git a/cli/js/util.ts b/cli/js/util.ts
index a67dec595..d68a6cb51 100644
--- a/cli/js/util.ts
+++ b/cli/js/util.ts
@@ -110,14 +110,9 @@ function pathFromURLPosix(url: URL): string {
}
export function pathFromURL(pathOrUrl: string | URL): string {
- if (typeof pathOrUrl == "string") {
- try {
- pathOrUrl = new URL(pathOrUrl);
- } catch {}
- }
if (pathOrUrl instanceof URL) {
if (pathOrUrl.protocol != "file:") {
- throw new TypeError("Must be a path string or file URL.");
+ throw new TypeError("Must be a file URL.");
}
return build.os == "windows"