From 2c41d8b44e5ade83c8e5391f4bdcc48e151d4bce Mon Sep 17 00:00:00 2001 From: Sam Lanning Date: Thu, 30 Aug 2018 14:08:24 -0700 Subject: [PATCH] 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 --- src/compiler/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 1eaab5b1b59..d5caadf079a 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -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; } }