Sitelet https://github.com/nodejs/node/commit/176f8c35c5
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 <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 09056fd commit 176f8c3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎lib/internal/url.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,7 @@ function pathToFileurl(/sitelet?url=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fcommit%2Ffilepath) {
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)