Skip to content

Locking memoryless Callbacks aborts current execution #1990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gibson042 opened this issue Jan 4, 2015 · 0 comments
Closed

Locking memoryless Callbacks aborts current execution #1990

gibson042 opened this issue Jan 4, 2015 · 0 comments
Assignees
Milestone

Comments

@gibson042
Copy link
Member

http://jsfiddle.net/2d9gwd2c/

Note how .lock() aborts active execution unless the "memory" flag is set. This is arguably by design, but it seems to me that the purpose of the method is preventing effects of future fire calls—execution interruption being more properly provided by the "stopOnFalse" flag.

This has probably gone unnoticed for lack of use (all of our internal callbacks have memory), but nonetheless would be a breaking fix and called for with a major version bump.

In code, this assertion fails:

var completed,
    list = jQuery.Callbacks();
list.add( list.lock );
list.add(function() { completed = true; });
list.fire();
equal( completed, true );
@gibson042 gibson042 self-assigned this Jan 4, 2015
@gibson042 gibson042 added this to the 3.0.0 milestone Jan 4, 2015
gibson042 added a commit that referenced this issue Jan 11, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants