Skip to content

Commit 4d0faf4

Browse files
anonrigdanielleadams
authored andcommitted
url: improve isURLThis detection
PR-URL: #46866 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent b344e74 commit 4d0faf4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/internal/url.js

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const {
1717
ObjectGetOwnPropertySymbols,
1818
ObjectGetPrototypeOf,
1919
ObjectKeys,
20+
ObjectPrototypeHasOwnProperty,
2021
ReflectApply,
2122
ReflectGetOwnPropertyDescriptor,
2223
ReflectOwnKeys,
@@ -568,6 +569,10 @@ function onParseComplete(flags, protocol, username, password,
568569
initSearchParams(this[searchParams], query);
569570
}
570571

572+
function isURLThis(self) {
573+
return self != null && ObjectPrototypeHasOwnProperty(self, context);
574+
}
575+
571576
function onParseError(input, flags) {
572577
throw new ERR_INVALID_URL(input);
573578
}

0 commit comments

Comments
 (0)