Skip to content
Browse files

Fix bug that prevented regexes from being excluded in a FileList.

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...
1 parent b244e46 commit 6f3ac7265557d07baabdc27e6525e147f5399583 @paulbaumgart committed Jul 16, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jake/filelist.js
View
2 lib/jake/filelist.js
@@ -187,7 +187,7 @@ FileList.prototype.exclude = function(/*Strings|Functions*/)
{
Array.prototype.forEach.call(arguments, function(/*String|Function*/ anObject)
{
- if (typeof anObject === "function")
+ if (typeof anObject === "function" && anObject.apply)
this._excludedProcs.push(anObject);
else

0 comments on commit 6f3ac72

Please sign in to comment.
Something went wrong with that request. Please try again.