Skip to main content

Bug Tracker

Side navigation

#12665 closed bug (fixed)

Opened October 06, 2012 07:56PM UTC

Closed October 06, 2012 08:01PM UTC

Callbacks objects with "unique" flag will iterate over a function's methods when it is added a second time

Reported by: jaubourg Owned by: jaubourg
Priority: blocker Milestone: 1.8.3
Component: deferred Version: git
Keywords: Cc:
Blocked by: Blocking:
Description

[[http://jsfiddle.net/krisselden/JFSNW/|Fiddle]]

Culprit is [[https://github.com/jquery/jquery/blob/master/src/callbacks.js#L96|too wide a test]] that will make Callbacks.add iterate over a function that is defined with at least a single parameter and has already been added to the same Callbacks instance.

Reported on github by [[https://github.com/kselden|kselden]] [[https://github.com/jquery/jquery/commit/87c83b04589e91a96adcfce788c6207295f83a5b#commitcomment-1956884|here]].

Attachments (0)
Change History (2)

Changed October 06, 2012 07:57PM UTC by jaubourg comment:1

component: unfileddeferred
milestone: None1.8.3
owner: → jaubourg
priority: undecidedblocker
status: newassigned

Changed October 06, 2012 08:01PM UTC by jaubourg comment:2

resolution: → fixed
status: assignedclosed

Do not iterate over functions. Fixes #12665. Unit tests added. Thanks to @kselden for finding the bug.

Changeset: bb38f706463a4d7598505b2f7adf3ed83935f298