Bug Tracker

Modify

Ticket #11511 (closed enhancement: invalid)

Opened 14 months ago

Last modified 14 months ago

delay should not cause the second argument to be called if it's a function

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

Description

I see in this ticket: http://bugs.jquery.com/ticket/8489 that delay will not have a callback as its second argument. Problem is if someone overlooks the doc and try to use it as a callback, it actually gets called anyway at the first dequeue:  https://github.com/jquery/jquery/blob/master/src/queue.js#L89 but not at the subsequent ones:  http://jsfiddle.net/KcXVv/1/

It can lead to code hard to debug. If it works the first time, you might think you got the arguments right and overlook the doc.

Maybe something like that:  https://github.com/chrif/jquery/commit/97b4e456ce535fc008c2a2cb6e45e297d76be2c2#src/queue.js

Change History

comment:1 Changed 14 months ago by rwaldron

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

Overlooking the docs is not a bug in jQuery, especially when the docs are very clear:  http://api.jquery.com/delay/

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.