From 176f8c35c57ff94d75bf006c0d893e6a668c9665 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 78f5b32745a043..e79f3d7ce4f2fc 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1394,8 +1394,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) {