Skip to content

Commit 2a63b98

Browse files
committed
Use Sizzle.Expr.match.globalPOS for identifying POS selectors in traversing. Fixes #10970.
1 parent 9bea216 commit 2a63b98

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/sizzle

Submodule sizzle updated 1 file

src/traversing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var runtil = /Until$/,
66
rmultiselector = /,/,
77
isSimple = /^.[^:#\[\.,]*$/,
88
slice = Array.prototype.slice,
9-
POS = jQuery.expr.match.POS,
9+
POS = jQuery.expr.match.globalPOS,
1010
// methods guaranteed to produce a unique set when starting from a unique set
1111
guaranteedUnique = {
1212
children: true,

test/unit/traversing.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test("find(node|jQuery object)", function() {
3838
});
3939

4040
test("is(String|undefined)", function() {
41-
expect(29);
41+
expect(30);
4242
ok( jQuery("#form").is("form"), "Check for element: A form must be a form" );
4343
ok( !jQuery("#form").is("div"), "Check for element: A form is not a div" );
4444
ok( jQuery("#mark").is(".blog"), "Check for class: Expected class 'blog'" );
@@ -70,8 +70,10 @@ test("is(String|undefined)", function() {
7070
ok( jQuery("#en").is("[lang=\"en\"] , [lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
7171
ok( jQuery("#en").is("[lang=\"de\"] , [lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
7272

73-
ok( !jQuery(window).is('a'), "Checking is on a window does not throw an exception(#10178)" );
74-
ok( !jQuery(document).is('a'), "Checking is on a document does not throw an exception(#10178)" );
73+
ok( !jQuery(window).is("a"), "Checking is on a window does not throw an exception(#10178)" );
74+
ok( !jQuery(document).is("a"), "Checking is on a document does not throw an exception(#10178)" );
75+
76+
ok( jQuery("#option1b").is("#select1 option:not(:first)"), "POS inside of :not() (#10970)" );
7577
});
7678

7779
test("is(jQuery)", function() {

0 commit comments

Comments
 (0)