Skip to content

Commit

Permalink
Fix bug that prevented regexes from being excluded in a FileList.
Browse files Browse the repository at this point in the history
In exclude(), regexes were being categorized with other functions
(because their type is "function"), but they cannot be .apply()'d.
Now, objects must be both typeof "function" and have a .apply
member in order to be attached to the excludedProcs array.
  • Loading branch information
paulbaumgart committed Jul 16, 2010
1 parent b244e46 commit 6f3ac72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jake/filelist.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ FileList.prototype.exclude = function(/*Strings|Functions*/)
{ {
Array.prototype.forEach.call(arguments, function(/*String|Function*/ anObject) Array.prototype.forEach.call(arguments, function(/*String|Function*/ anObject)
{ {
if (typeof anObject === "function") if (typeof anObject === "function" && anObject.apply)
this._excludedProcs.push(anObject); this._excludedProcs.push(anObject);


else else
Expand Down

0 comments on commit 6f3ac72

Please sign in to comment.