From 8825eb4d734c78ccdaa06811a5b033e59f7fa978 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 4 Aug 2020 09:13:09 -0700 Subject: [PATCH] lib: use non-symbols in isURLInstance check PR-URL: https://github.com/nodejs/node/pull/34622 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- lib/internal/url.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index 7c2637246e9b51..b65e2cb9b14e4c 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1390,8 +1390,7 @@ function pathToFileURL(filepath) { } function isURLInstance(fileURLOrPath) { - return fileURLOrPath != null && fileURLOrPath[searchParams] && - fileURLOrPath[searchParams][searchParams]; + return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin; } function toPathIfFileURL(fileURLOrPath) {