Selector: Add a test for throwing on post-comma invalid selectors

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
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-10-21 19:03:03 +02:00 committed by GitHub
parent 1d624c10b4
commit 6eee5f7f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {
@ -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" );