From 5a6a44311a605cc4ac995fa2894d28dc886f0f50 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Feb 2023 08:18:03 -0500 Subject: [PATCH] url: improve `isURLThis` detection --- lib/internal/url.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index c4640a68b28d23..3b61f432b91dad 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -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 {