aboutsummaryrefslogtreecommitdiffstats
path: root/test/AngularSpec.js
diff options
context:
space:
mode:
authorIgor Minar2013-01-21 22:00:15 -0800
committerIgor Minar2013-01-22 07:35:21 -0800
commit3c2e1c5e4d12529b1d69a6173c38097527dccc4f (patch)
tree50d4901d56bc66324a1cd1cf72850140851f2a7a /test/AngularSpec.js
parentcdf7781878dc43de85e7a72fcfce0105d93db621 (diff)
downloadangular.js-3c2e1c5e4d12529b1d69a6173c38097527dccc4f.tar.bz2
fix(angular.equals): relax the comparison for undefined properties
in 5ae63fd3 the comparison was made consistent but strict, so that angular.equals({}, {foo: undefined}) // always returns false this turns out to cause issues for data that is being roundtripped via network and serialized via JSON because JSON.stringify serializes {foo: undefined} as {}. Since angular.equals() behaved like this before the 5ae63fd3 in 50% of the cases, changing the behavior in this way should not introduce any significant issues. Closes #1648
Diffstat (limited to 'test/AngularSpec.js')
-rw-r--r--test/AngularSpec.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index f5638b9c..09bc902f 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -126,12 +126,12 @@ describe('angular', function() {
expect(equals(['misko'], ['misko', 'adam'])).toEqual(false);
});
- it('should ignore undefined member variables', function() {
+ it('should ignore undefined member variables during comparison', function() {
var obj1 = {name: 'misko'},
obj2 = {name: 'misko', undefinedvar: undefined};
- expect(equals(obj1, obj2)).toBe(false);
- expect(equals(obj2, obj1)).toBe(false);
+ expect(equals(obj1, obj2)).toBe(true);
+ expect(equals(obj2, obj1)).toBe(true);
});
it('should ignore $ member variables', function() {