Skip to content

Commit 4d0faf4

Browse files
anonrigdanielleadams
authored andcommitted
url: improve isURLThis detection
PR-URL: #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>
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

Lines changed: 5 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy