MCPcopy
hub / github.com/jquery/esprima / groupScan

Function groupScan

test/3rdparty/angular-1.2.5.js:5705–5728  ·  view source on GitHub ↗

* Given a node with an directive-start it collects all of the siblings until it finds * directive-end. * @param node * @param attrStart * @param attrEnd * @returns {*}

(node, attrStart, attrEnd)

Source from the content-addressed store, hash-verified

5703 * @returns {*}
5704 */
5705 function groupScan(node, attrStart, attrEnd) {
5706 var nodes = [];
5707 var depth = 0;
5708 if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
5709 var startNode = node;
5710 do {
5711 if (!node) {
5712 throw $compileMinErr('uterdir',
5713 "Unterminated attribute, found '{0}' but no matching '{1}' found.",
5714 attrStart, attrEnd);
5715 }
5716 if (node.nodeType == 1 /** Element **/) {
5717 if (node.hasAttribute(attrStart)) depth++;
5718 if (node.hasAttribute(attrEnd)) depth--;
5719 }
5720 nodes.push(node);
5721 node = node.nextSibling;
5722 } while (depth > 0);
5723 } else {
5724 nodes.push(node);
5725 }
5726
5727 return jqLite(nodes);
5728 }
5729
5730 /**
5731 * Wrapper for linking function which converts normal linking function into a grouped

Callers 2

applyDirectivesToNodeFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…