Skip to content

Commit

Permalink
checking instanceof Function because of weird Safari bug for NodeList
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Barnes committed Jan 23, 2014
1 parent f31a2e6 commit 276dfc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function toArray(collection) {
if (typeof collection === 'string') return [collection]
if (isArray(collection)) return collection
if (typeof collection.length != 'number') return [collection]
if (typeof collection === 'function') return [collection]
if (typeof collection === 'function' && collection instanceof Function) return [collection]

var arr = []
for (var i = 0; i < collection.length; i++) {
Expand Down

1 comment on commit 276dfc1

@javve
Copy link
Contributor

@javve javve commented on 276dfc1 Mar 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this fixes critical bug in List.js ❤️

Please sign in to comment.