Skip to content
Permalink
Browse files
Added some more tests for checking the execution order of events (fro…
…m last night's changes - routes around Chrome's busted object looping abilities).
  • Loading branch information
jeresig committed Feb 4, 2010
1 parent e177465 commit 104757705a19df3b6b9750aaef30aa451082f825
Showing 1 changed file with 20 additions and 0 deletions.
@@ -317,6 +317,26 @@ test("bind(), with same function", function() {

equals(count, 1, "Verify that removing events still work." );
});

test("bind(), make sure order is maintained", function() {
expect(1);

var elem = jQuery("#firstp"), log = [], check = [];

for ( var i = 0; i < 100; i++ ) (function(i){
elem.bind( "click", function(){
log.push( i );
});

check.push( i );
})(i);

elem.trigger("click");

equals( log.join(","), check.join(","), "Make sure order was maintained." );

elem.unbind("click");
});

test("bind(), with different this object", function() {
expect(4);

3 comments on commit 1047577

@leeoniya
Copy link

@leeoniya leeoniya commented on 1047577 Feb 4, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should file a Chrome bug and get paid : )

@jeresig
Copy link
Member Author

@jeresig jeresig commented on 1047577 Feb 4, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waaaayy ahead of you:
http://code.google.com/p/chromium/issues/detail?id=883

Been open for over 2 years at this point.

@leeoniya
Copy link

@leeoniya leeoniya commented on 1047577 Feb 4, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, good luck getting paid in that case. hahaha

Please sign in to comment.