Ticket #3134 (closed bug: duplicate)
Tweak to .isFunction
| Reported by: | john | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | core | Version: | 1.2.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Based upon discussion in jQuery-dev, a tweak to the isFunction method to make it more robust.
It will no longer fail in cases like this:
function Test(){}
Test.toString = function(){ return "Test"; };
Attachments
Change History
Changed 5 years ago by john
-
attachment
toString.diff
added
comment:1 Changed 5 years ago by genezys
Hi, I started following the jquery-dev list and thought I could help for this one.
First, I will attach a patch to add the two failing tests to the jQuery unit tests.
Then, I should add that applying the current patch seems to be breaking a lot of unit tests right now. I will be investigating the issue.
Changed 5 years ago by genezys
-
attachment
toString-tests.2.diff
added
Complex version but passes all tests
Changed 5 years ago by genezys
-
attachment
toString-tests.diff
added
Added test for alert() and prompt() in IE
Changed 5 years ago by genezys
-
attachment
toString-complex-but-ok.diff
added
Complex version but passes all tests
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Change toString functionality in isFunction