Skip to content

Commit

Permalink
lib: use non-symbols in isURLInstance check
Browse files Browse the repository at this point in the history
PR-URL: #34622
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
codebytere authored and addaleax committed Sep 22, 2020
1 parent 09056fd commit 176f8c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 176f8c3

Please sign in to comment.