mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00: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:
@@ -16,6 +16,7 @@ const {
|
||||
ObjectGetOwnPropertySymbols,
|
||||
ObjectGetPrototypeOf,
|
||||
ObjectKeys,
|
||||
ObjectPrototypeHasOwnProperty,
|
||||
ReflectGetOwnPropertyDescriptor,
|
||||
ReflectOwnKeys,
|
||||
RegExpPrototypeSymbolReplace,
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user