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

Function collectCommentDirectives

lib/test/angular/1.8.0/angular.js:10089–10105  ·  view source on GitHub ↗
(node, directives, attrs, maxPriority, ignoreDirective)

Source from the content-addressed store, hash-verified

10087 }
10088
10089 function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
10090 // function created because of performance, try/catch disables
10091 // the optimization of the whole function #14848
10092 try {
10093 var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
10094 if (match) {
10095 var nName = directiveNormalize(match[1]);
10096 if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
10097 attrs[nName] = trim(match[2]);
10098 }
10099 }
10100 } catch (e) {
10101 // turns out that under some circumstances IE9 throws errors when one attempts to read
10102 // comment's node value.
10103 // Just ignore it and continue. (Can't seem to reproduce in test case.)
10104 }
10105 }
10106
10107 /**
10108 * 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