Dario95

Untitled

Jul 15th, 2021 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2.     var bySet = setMatchers.length > 0,
  3.         byElement = elementMatchers.length > 0,
  4.         superMatcher = function( seed, context, xml, results, outermost ) {
  5.             var elem, j, matcher,
  6.                 matchedCount = 0,
  7.                 i = "0",
  8.                 unmatched = seed && [],
  9.                 setMatched = [],
  10.                 contextBackup = outermostContext,
  11.                 // We must always have either seed elements or outermost context
  12.                 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  13.                 // Use integer dirruns iff this is the outermost matcher
  14.                 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  15.                 len = elems.length;
  16.  
  17.             if ( outermost ) {
  18.                 outermostContext = context === document || context || outermost;
  19.             }
Add Comment
Please, Sign In to add comment