Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
util: isEqualBoxedPrimitive: ensure both values are actual boxed Symbols
... before trying to valueOf them
  • Loading branch information
ljharb committed Aug 7, 2019
commit d90707a8c5821bd38d9dd3efcce9eae984c343d7
7 changes: 5 additions & 2 deletions lib/internal/util/comparisons.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ function isEqualBoxedPrimitive(val1, val2) {
return isBigIntObject(val2) &&
BigIntPrototype.valueOf(val1) === BigIntPrototype.valueOf(val2);
}
return isSymbolObject(val2) &&
SymbolPrototype.valueOf(val1) === SymbolPrototype.valueOf(val2);
if (isSymbolObject(val1)) {
return isSymbolObject(val2) &&
SymbolPrototype.valueOf(val1) === SymbolPrototype.valueOf(val2);
}
return false;
}

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