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 112ec73

Browse filesBrowse files
ljharbtargos
authored andcommitted
util: isEqualBoxedPrimitive: ensure both values are actual boxed Symbols
... before trying to valueOf them PR-URL: #29029 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 8426077 commit 112ec73
Copy full SHA for 112ec73

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎lib/internal/util/comparisons.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/comparisons.js
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ function isEqualBoxedPrimitive(val1, val2) {
9898
return isBigIntObject(val2) &&
9999
BigIntPrototype.valueOf(val1) === BigIntPrototype.valueOf(val2);
100100
}
101-
return isSymbolObject(val2) &&
102-
SymbolPrototype.valueOf(val1) === SymbolPrototype.valueOf(val2);
101+
if (isSymbolObject(val1)) {
102+
return isSymbolObject(val2) &&
103+
SymbolPrototype.valueOf(val1) === SymbolPrototype.valueOf(val2);
104+
}
105+
return false;
103106
}
104107

105108
// Notes: Type tags are historical [[Class]] properties that can be set by

0 commit comments

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