Bug Tracker

Opened 15 years ago

Closed 15 years ago

#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:
Blocked by: Blocking:

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 (4)

toString.diff (538 bytes) - added by john 15 years ago.
Change toString functionality in isFunction
toString-tests.2.diff (964 bytes) - added by genezys 15 years ago.
Complex version but passes all tests
toString-tests.diff (1.1 KB) - added by genezys 15 years ago.
Added test for alert() and prompt() in IE
toString-complex-but-ok.diff (690 bytes) - added by genezys 15 years ago.
Complex version but passes all tests

Download all attachments as: .zip

Change History (8)

Changed 15 years ago by john

Attachment: toString.diff added

Change toString functionality in isFunction

comment:1 Changed 15 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 15 years ago by genezys

Attachment: toString-tests.2.diff added

Complex version but passes all tests

Changed 15 years ago by genezys

Attachment: toString-tests.diff added

Added test for alert() and prompt() in IE

Changed 15 years ago by genezys

Complex version but passes all tests

comment:2 Changed 15 years ago by genezys

Sorry, I messed up with Attach File... Can someone please delete "toString-tests.2.diff"

comment:3 Changed 15 years ago by genezys

This bug is fixed by a patch in #2968

comment:4 Changed 15 years ago by flesler

Resolution: duplicate
Status: newclosed

Duplicate of #2968. Fixed on [5792].

Note: See TracTickets for help on using tickets.