mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix(orderBy): make object-to-primtiive behaviour work for objects with null prototype
This commit is contained in:
@@ -115,6 +115,16 @@ describe('Filter: orderBy', function() {
|
||||
];
|
||||
expect(orderBy(array)).toEqualData(array);
|
||||
});
|
||||
|
||||
|
||||
it('should not reverse array of objects with null prototype and no predicate', function() {
|
||||
var array = [2,1,4,3].map(function(id) {
|
||||
var obj = Object.create(null);
|
||||
obj.id = id;
|
||||
return obj;
|
||||
});
|
||||
expect(orderBy(array)).toEqualData(array);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -232,5 +242,15 @@ describe('Filter: orderBy', function() {
|
||||
];
|
||||
expect(orderBy(array)).toEqualData(array);
|
||||
});
|
||||
|
||||
|
||||
it('should not reverse array of objects with null prototype and no predicate', function() {
|
||||
var array = [2,1,4,3].map(function(id) {
|
||||
var obj = Object.create(null);
|
||||
obj.id = id;
|
||||
return obj;
|
||||
});
|
||||
expect(orderBy(array)).toEqualData(array);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user