Skip to content

Commit 2c41d8b

Browse files
committed
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
1 parent 65fa012 commit 2c41d8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ namespace ts {
12721272
if (!left || !right) return false;
12731273
for (const key in left) {
12741274
if (hasOwnProperty.call(left, key)) {
1275-
if (!hasOwnProperty.call(right, key) === undefined) return false;
1275+
if (!hasOwnProperty.call(right, key)) return false;
12761276
if (!equalityComparer(left[key], right[key])) return false;
12771277
}
12781278
}

0 commit comments

Comments
 (0)