Skip to content

Commit 6e41d7d

Browse files
committed
Use safer isArray
`object instanceof Array` is not safe in multi-frame environments. See http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ for more information.
1 parent eef41d4 commit 6e41d7d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

js/ReactFireMixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var ReactFireMixin;
6262
/*************/
6363
/* Returns true if the inputted object is a JavaScript array */
6464
_isArray: function(obj) {
65-
return (obj && typeof obj === "object" && obj instanceof Array);
65+
return Object.prototype.toString.call(obj) === "[object Array]";
6666
},
6767

6868
/* Converts a Firebase object to a JavaScript array */

js/ReactFireMixin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)