diff options
Diffstat (limited to 'src/traversing.js')
-rw-r--r-- | src/traversing.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/traversing.js b/src/traversing.js index c1798a44f..2f649988d 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -1,4 +1,5 @@ var isSimple = /^.[^:#\[\.,]*$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { @@ -200,8 +201,8 @@ jQuery.each({ ret = jQuery.unique( ret ); } - // Reverse order for parents* and prev* - if ( name.charAt(0) === "p" && name !== "parent" ) { + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } |