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

Commit 3c2aee0

Browse files
committed
fix(*): don't use instanceof to detect arrays
this breaks when multiple javascript contexts are involved - like in node-webkit see original PR: #1966 Closes #1966
1 parent 37bdcc9 commit 3c2aee0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ng/filter/filter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
*/
107107
function filterFilter() {
108108
return function(array, expression, comperator) {
109-
if (!(array instanceof Array)) return array;
109+
if (!isArray(array)) return array;
110110
var predicates = [];
111111
predicates.check = function(value) {
112112
for (var j = 0; j < predicates.length; j++) {

src/ng/filter/orderBy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
orderByFilter.$inject = ['$parse'];
9090
function orderByFilter($parse){
9191
return function(array, sortPredicate, reverseOrder) {
92-
if (!(array instanceof Array)) return array;
92+
if (!isArray(array)) return array;
9393
if (!sortPredicate) return array;
9494
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
9595
sortPredicate = map(sortPredicate, function(predicate){

0 commit comments

Comments
 (0)