From 1dcafd18afed4465ee13db91cedc8fecc3aa2c96 Mon Sep 17 00:00:00 2001 From: Brenton Date: Sat, 1 Jun 2013 23:29:18 -0700 Subject: fix(equals): {} and [] should not be considered equivalent angular.equals was returning inconsistent values for the comparison between {} and []: angular.equals({}, []) // true angular.equals([], {}]) // false Since these object are not of the same type, they should not be considered equivalent. --- src/Angular.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index a41ef4e8..4e050a0c 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -687,6 +687,7 @@ function equals(o1, o2) { if (t1 == t2) { if (t1 == 'object') { if (isArray(o1)) { + if (!isArray(o2)) return false; if ((length = o1.length) == o2.length) { for(key=0; key