mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Fix equalOwnProperties
equalOwnProperties would incorrectly report two map-like objects as equal in the case where a property defined in `left` was not defined in `right` and whose value was considered "equal" to undefined by the equalityComparer. This bug was found by an alert on LGTM.com
This commit is contained in:
parent
65fa0128bb
commit
2c41d8b44e
@ -1272,7 +1272,7 @@ namespace ts {
|
||||
if (!left || !right) return false;
|
||||
for (const key in left) {
|
||||
if (hasOwnProperty.call(left, key)) {
|
||||
if (!hasOwnProperty.call(right, key) === undefined) return false;
|
||||
if (!hasOwnProperty.call(right, key)) return false;
|
||||
if (!equalityComparer(left[key], right[key])) return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user