Revert "Callbacks: Don't abort execution on .lock()"

This reverts commit 32bf9178ca.
This commit is contained in:
Oleg Gaidarenko 2015-11-13 16:38:00 +03:00
parent cad0f469a8
commit 793925ff3b
2 changed files with 28 additions and 38 deletions

View File

@ -206,7 +206,7 @@ jQuery.Callbacks = function( options ) {
lock: function() {
stack = undefined;
locked = true;
if ( !memory && !firing ) {
if ( !memory ) {
self.disable();
}
return this;

View File

@ -65,7 +65,7 @@ jQuery.each( tests, function( strFlags, resultString ) {
QUnit.test( "jQuery.Callbacks( " + showFlags( flags ) + " ) - " + filterLabel, function( assert ) {
assert.expect( 29 );
assert.expect( 28 );
var cblist,
results = resultString.split( /\s+/ );
@ -164,16 +164,6 @@ jQuery.each( tests, function( strFlags, resultString ) {
assert.strictEqual( output, "X", "Lock early" );
assert.strictEqual( cblist.locked(), true, "Locking reflected in accessor" );
// Locking while firing (gh-1990)
output = "X";
cblist = jQuery.Callbacks( flags );
cblist.add( cblist.lock );
cblist.add( function( str ) {
output += str;
} );
cblist.fire( "A" );
assert.strictEqual( output, "XA", "Locking doesn't abort execution (gh-1990)" );
// Ordering
output = "X";
cblist = jQuery.Callbacks( flags );