@@ -1289,17 +1289,19 @@ QUnit.test( "Delegated events in SVG (#10791; #13180)", function( assert ) {
12891289 jQuery ( "#qunit-fixture" ) . off ( "click" ) ;
12901290} ) ;
12911291
1292- QUnit . test ( "Delegated events with malformed selectors (# 3071)" , function ( assert ) {
1293- assert . expect ( 2 ) ;
1292+ QUnit . test ( "Delegated events with malformed selectors (gh- 3071)" , function ( assert ) {
1293+ assert . expect ( 3 ) ;
12941294
1295- assert . throws ( function ( ) {
1296- jQuery ( "#qunit-fixture " ) . on ( "click" , "div :not" , function ( ) { } ) ;
1297- } , null , "malformed selector throws on attach" ) ;
1295+ assert . throws ( function ( ) {
1296+ jQuery ( "#foo " ) . on ( "click" , ":not" , function ( ) { } ) ;
1297+ } , "malformed selector throws on attach" ) ;
12981298
1299- jQuery ( "#qunit-fixture" ) . click ( ) ;
1300- assert . ok ( true , "malformed selector does not throw on event" ) ;
1299+ assert . throws ( function ( ) {
1300+ jQuery ( "#foo" ) . on ( "click" , "nonexistent:not" , function ( ) { } ) ;
1301+ } , "short-circuitable malformed selector throws on attach" ) ;
13011302
1302- jQuery ( "#qunit-fixture" ) . off ( "click" ) ;
1303+ jQuery ( "#foo > :first-child" ) . click ( ) ;
1304+ assert . ok ( true , "malformed selector does not throw on event" ) ;
13031305} ) ;
13041306
13051307QUnit . test ( "Delegated events in forms (#10844; #11145; #8165; #11382, #11764)" , function ( assert ) {
0 commit comments