lib: use non-symbols in isURLInstance check

PR-URL: https://github.com/nodejs/node/pull/34622
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Shelley Vohr 2020-08-04 09:13:09 -07:00 committed by Rich Trott
parent bdfc59893d
commit 8825eb4d73

View File

@ -1390,8 +1390,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) {