Bug Tracker

Modify

Ticket #511 (closed bug: fixed)

Opened 7 years ago

Last modified 6 years ago

pushStack misinterprets function args

Reported by: Dave Owned by:
Priority: major Milestone:
Component: core Version:
Keywords: Cc:
Blocking: Blocked by:

Description

The problem occurs with destructive methods like .filter(fn) that take a function argument used by the method. pushStack sees that function arg and interprets it incorrectly.

I think this should fix the problem, but only for the case of a destructive method that takes a single function arg in addition to the two (optional) trailing function args--I think that's the only kind at the moment. However, this can still run afoul of the bug where Firefox <object> elements are wrongfully interpreted as functions (see the ugly expression at the top of the jQuery() constructor.)

<<<

pushStack: function(a,args) {

var fn = args && args.length > 1 && args[args.length-1]; var fn2 = args && args.length > 2 && args[args.length-2];

Change History

comment:1 Changed 7 years ago by joern

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

Fixed in SVN.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.