Bug Tracker

Ticket #3134 (closed bug: duplicate)

Opened 6 years ago

Last modified 6 years ago

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

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

Change History

Changed 6 years ago by john

Change toString functionality in isFunction

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

Complex version but passes all tests

Changed 6 years ago by genezys

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

Changed 6 years ago by genezys

Complex version but passes all tests

comment:2 Changed 6 years ago by genezys

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

comment:3 Changed 6 years ago by genezys

This bug is fixed by a patch in #2968

comment:4 Changed 6 years ago by flesler

  • Status changed from new to closed
  • Resolution set to duplicate

Duplicate of #2968. Fixed on [5792].

Note: See TracTickets for help on using tickets.