diff --git a/src/ng/compile.js b/src/ng/compile.js index 68e49f2bcaf1..015886976efe 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -2052,6 +2052,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { addTextInterpolateDirective(directives, node.nodeValue); break; case NODE_TYPE_COMMENT: /* Comment */ + collectCommentDirectives(); + break; + } + + directives.sort(byPriority); + return directives; + + function collectCommentDirectives() { + // function created because of performance, try/catch disables + // the optimization of the whole function #14848 try { match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); if (match) { @@ -2065,11 +2075,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { // comment's node value. // Just ignore it and continue. (Can't seem to reproduce in test case.) } - break; } - - directives.sort(byPriority); - return directives; } /**