Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ function tokenize( selector, parseOnly ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
soFar = soFar.slice( match[0].length );
// Don't consume trailing commas as valid
soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( tokens = [] );
}
Expand Down
3 changes: 2 additions & 1 deletion test/unit/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ test("XML Document Selectors", function() {
});

test("broken", function() {
expect( 21 );
expect( 22 );

function broken( name, selector ) {
raises(function() {
Expand All @@ -183,6 +183,7 @@ test("broken", function() {
broken( "Broken Selector", "{}" );
broken( "Broken Selector", "," );
broken( "Broken Selector", ",a" );
broken( "Broken Selector", "a," );
// Hangs on IE 9 if regular expression is inefficient
broken( "Broken Selector", "[id=012345678901234567890123456789");
broken( "Doesn't exist", ":visble" );
Expand Down