From d0efaf2fe337035f56652e0168a5d397e266d3af 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 c0b8c17d098708..71b0dd26e2735a 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1391,8 +1391,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) {