mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Revert "Callbacks: Don't abort execution on .lock()"
This reverts commit 32bf9178ca
.
This commit is contained in:
parent
cad0f469a8
commit
793925ff3b
@ -206,7 +206,7 @@ jQuery.Callbacks = function( options ) {
|
||||
lock: function() {
|
||||
stack = undefined;
|
||||
locked = true;
|
||||
if ( !memory && !firing ) {
|
||||
if ( !memory ) {
|
||||
self.disable();
|
||||
}
|
||||
return this;
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user