MCPcopy Create free account
hub / github.com/JsAaron/jQuery / elementMatcher

Function elementMatcher

2.0.3/Sizzle-annotation.js:1732–1749  ·  view source on GitHub ↗
(matchers)

Source from the content-addressed store, hash-verified

1730 }
1731
1732 function elementMatcher(matchers) {
1733 //生成一个终极匹配器
1734 return matchers.length > 1 ?
1735 //如果是多个匹配器的情况,那么就需要elem符合全部匹配器规则
1736 function(elem, context, xml) {
1737 var i = matchers.length;
1738 //从右到左开始匹配
1739 while (i--) {
1740 //如果有一个没匹配中,那就说明该节点elem不符合规则
1741 if (!matchers[i](elem, context, xml)) {
1742 return false;
1743 }
1744 }
1745 return true;
1746 } :
1747 //单个匹配器的话就返回自己即可
1748 matchers[0];
1749 }
1750
1751 function condense(unmatched, map, filter, context, xml) {
1752 var elem,

Callers 1

matcherFromTokensFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected