Bug Tracker

Ticket #10948 (closed enhancement: duplicate)

Opened 3 years ago

Last modified 3 years ago

Proposing to add similar to $.fn.eq behavior for $.fn.end method.

Reported by: markel Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

Sometimes traverse chain might be long, sometimes it is required to climb couple states up, instead of one.
Than, in order not to break chain and not traverse some more, it's need to call end method couple times, like when you use parentNode property in DOM.

I'm proposing to eliminate this calls by replacing them to just one call with extra argument if needed.

Change History

comment:1 Changed 3 years ago by markel

comment:2 Changed 3 years ago by scott.gonzalez

I feel like this had been proposed before and denied because it encourages developers to write code that is hard to read. I can't seem to find the old discussion, I did a quick check in Trac and the 1.6 and 1.7 roadmap proposals.

comment:3 Changed 3 years ago by dmethvin

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

Definitely makes code harder to read. Match up each filtering method with an .end() instead.

We like to keep the pull queue relatively clean, so please query about these on #jquery-dev before making pull requests.

comment:4 Changed 3 years ago by dmethvin

Duplicate of #6457.

Note: See TracTickets for help on using tickets.