Bug Tracker

Ticket #10952 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

.fired() doesn't work on Callbacks object when it is flagged with "once"

Reported by: dtipson@… Owned by: jaubourg
Priority: low Milestone: 1.7.2
Component: misc Version: 1.7.1
Keywords: Cc: jaubourg
Blocking: Blocked by:


Adding the flags "once" or "once unique" to a callbacks object seems to disable the ability of .fired() to accurately reflect whether or not it was fired at least once. It always returns false, no matter how many times you fire the callback (it will only fire its functions once, obviously, but at that point it should be flagged as fired/resolved). This means that there is no simple way to tell if a callback has fired already (which is useful for triggering other loosely coupled behavior).


Same (wrong?) behavior in both 1.7 and 1.7.1

Change History

comment:1 Changed 4 years ago by addyosmani

  • Cc jaubourg added
  • Priority changed from undecided to low
  • Component changed from unfiled to misc

comment:2 Changed 4 years ago by jaubourg

  • Owner set to jaubourg
  • Status changed from new to assigned
  • Milestone changed from None to 1.7.2

comment:3 Changed 4 years ago by jaubourg

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

Fixes #10952 by introducing a real fired flag in the Callbacks closure.

jQuery Size - compared to last make

250235 (+69) jquery.js

94225 (+7) jquery.min.js 33445 (+3) jquery.min.js.gz

Changeset: eefead3d9629d68407600831a23c58a25163489e

Note: See TracTickets for help on using tickets.