Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(*): don't use instanceof to detect arrays
Browse files Browse the repository at this point in the history
this breaks when multiple javascript contexts are involved - like in node-webkit

see original PR: #1966

Closes #1966
  • Loading branch information
IgorMinar committed Feb 15, 2013
1 parent 14fd064 commit 526a6b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ng/filter/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
*/
function filterFilter() {
return function(array, expression) {
if (!(array instanceof Array)) return array;
if (!isArray(array)) return array;
var predicates = [];
predicates.check = function(value) {
for (var j = 0; j < predicates.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/filter/orderBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
orderByFilter.$inject = ['$parse'];
function orderByFilter($parse){
return function(array, sortPredicate, reverseOrder) {
if (!(array instanceof Array)) return array;
if (!isArray(array)) return array;
if (!sortPredicate) return array;
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
sortPredicate = map(sortPredicate, function(predicate){
Expand Down

0 comments on commit 526a6b3

Please sign in to comment.