MCPcopy
hub / github.com/angular-ui/ui-router / collectCommentDirectives

Function collectCommentDirectives

test/angular/1.6/angular.js:9477–9493  ·  view source on GitHub ↗
(node, directives, attrs, maxPriority, ignoreDirective)

Source from the content-addressed store, hash-verified

9475 }
9476
9477 function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
9478 // function created because of performance, try/catch disables
9479 // the optimization of the whole function #14848
9480 try {
9481 var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
9482 if (match) {
9483 var nName = directiveNormalize(match[1]);
9484 if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
9485 attrs[nName] = trim(match[2]);
9486 }
9487 }
9488 } catch (e) {
9489 // turns out that under some circumstances IE9 throws errors when one attempts to read
9490 // comment's node value.
9491 // Just ignore it and continue. (Can't seem to reproduce in test case.)
9492 }
9493 }
9494
9495 /**
9496 * Given a node with a directive-start it collects all of the siblings until it finds

Callers 1

collectDirectivesFunction · 0.70

Calls 3

directiveNormalizeFunction · 0.70
addDirectiveFunction · 0.70
trimFunction · 0.70

Tested by

no test coverage detected