Skip to content

Commit

Permalink
Selector: Add a test for throwing on post-comma invalid selectors
Browse files Browse the repository at this point in the history
Sizzle's PR jquery/sizzle#456 introduced a test catching not throwing on
badly-escaped identifiers by Firefox 3.6-5. Unfortunately, it was placed just
before a test Opera 10-11 failed, making Opera fail quicker and not adding
a post-comma invalid selector to rbuggyQSA.

The issue was fixed in jquery/sizzle#463. This jQuery commit backports the test
that Sizzle PR added as no workarounds are needed in browsers jQuery supports.

Closes gh-4516
Ref jquery/sizzle#456
Ref jquery/sizzle#463
  • Loading branch information
mgol committed Oct 21, 2019
1 parent 1d624c1 commit 6eee5f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/selector.js
Expand Up @@ -179,7 +179,7 @@ QUnit.test( "XML Document Selectors", function( assert ) {
} );

QUnit.test( "broken selectors throw", function( assert ) {
assert.expect( 32 );
assert.expect( 33 );

function broken( name, selector ) {
assert.throws( function() {
Expand All @@ -197,6 +197,7 @@ QUnit.test( "broken selectors throw", function( assert ) {
broken( "Broken Selector", "," );
broken( "Broken Selector", ",a" );
broken( "Broken Selector", "a," );
broken( "Post-comma invalid selector", "*,:x" );
broken( "Identifier with bad escape", "foo\\\fbaz" );
broken( "Broken Selector", "[id=012345678901234567890123456789" );
broken( "Doesn't exist", ":visble" );
Expand Down

0 comments on commit 6eee5f7

Please sign in to comment.