Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b10fe58

Browse filesBrowse files
anonrigtargos
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 08bf015 commit b10fe58
Copy full SHA for b10fe58

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/url.js‎

Copy file name to clipboardExpand all lines: lib/internal/url.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
ObjectGetOwnPropertySymbols,
1717
ObjectGetPrototypeOf,
1818
ObjectKeys,
19+
ObjectPrototypeHasOwnProperty,
1920
ReflectGetOwnPropertyDescriptor,
2021
ReflectOwnKeys,
2122
RegExpPrototypeSymbolReplace,
@@ -536,8 +537,7 @@ ObjectDefineProperties(URLSearchParams.prototype, {
536537
});
537538

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

543543
class URL {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.