Skip to content

Commit

Permalink
url: improve isURLThis detection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
anonrig authored and danielleadams committed Apr 11, 2023
1 parent b344e74 commit 4d0faf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const {
ObjectGetOwnPropertySymbols,
ObjectGetPrototypeOf,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ReflectApply,
ReflectGetOwnPropertyDescriptor,
ReflectOwnKeys,
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 4d0faf4

Please sign in to comment.