Skip to content

Commit 176f8c3

Browse files
codebytereaddaleax
authored andcommitted
lib: use non-symbols in isURLInstance check
PR-URL: #34622 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 09056fd commit 176f8c3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/url.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,7 @@ function pathToFileURL(filepath) {
13941394
}
13951395

13961396
function isURLInstance(fileURLOrPath) {
1397-
return fileURLOrPath != null && fileURLOrPath[searchParams] &&
1398-
fileURLOrPath[searchParams][searchParams];
1397+
return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;
13991398
}
14001399

14011400
function toPathIfFileURL(fileURLOrPath) {

0 commit comments

Comments
 (0)