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

Commit 526a6b3

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 14fd064 commit 526a6b3

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
@@ -82,7 +82,7 @@
8282
*/
8383
function filterFilter() {
8484
return function(array, expression) {
85-
if (!(array instanceof Array)) return array;
85+
if (!isArray(array)) return array;
8686
var predicates = [];
8787
predicates.check = function(value) {
8888
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)