mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
url: improve isURLThis detection
PR-URL: https://github.com/nodejs/node/pull/46866 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
b344e74bc1
commit
4d0faf4ddc
1 file changed
+5
@@ -17,6 +17,7 @@ const {
|
||||
ObjectGetOwnPropertySymbols,
|
||||
ObjectGetPrototypeOf,
|
||||
ObjectKeys,
|
||||
ObjectPrototypeHasOwnProperty,
|
||||
ReflectApply,
|
||||
ReflectGetOwnPropertyDescriptor,
|
||||
ReflectOwnKeys,
|
||||
@@ -568,6 +569,10 @@ function onParseComplete(flags, protocol, username, password,
|
||||
initSearchParams(this[searchParams], query);
|
||||
}
|
||||
|
||||
function isURLThis(self) {
|
||||
return self != null && ObjectPrototypeHasOwnProperty(self, context);
|
||||
}
|
||||
|
||||
function onParseError(input, flags) {
|
||||
throw new ERR_INVALID_URL(input);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user