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 Mar 1, 2023
1 parent da0bc6d commit 37c736f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const {
ObjectGetOwnPropertySymbols,
ObjectGetPrototypeOf,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ReflectGetOwnPropertyDescriptor,
ReflectOwnKeys,
RegExpPrototypeSymbolReplace,
Expand Down Expand Up @@ -536,8 +537,7 @@ ObjectDefineProperties(URLSearchParams.prototype, {
});

function isURLThis(self) {
// TODO(@anonrig): Use ObjectPrototypeHasOwnProperty to avoid prototype look
return (self !== undefined && self !== null && self[context] !== undefined);
return self != null && ObjectPrototypeHasOwnProperty(self, context);
}

class URL {
Expand Down

0 comments on commit 37c736f

Please sign in to comment.