mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-12 00:43:10 +00:00
fix(compiler): reading comment throws error in ie
Unders some circumstances reading the comment's text throws error.
This commit is contained in:
parent
94dd685709
commit
46bb08a9d0
1 changed files with 10 additions and 5 deletions
|
|
@ -467,12 +467,17 @@ function $CompileProvider($provide) {
|
||||||
addTextInterpolateDirective(directives, node.nodeValue);
|
addTextInterpolateDirective(directives, node.nodeValue);
|
||||||
break;
|
break;
|
||||||
case 8: /* Comment */
|
case 8: /* Comment */
|
||||||
match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
|
try {
|
||||||
if (match) {
|
match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
|
||||||
nName = directiveNormalize(match[1]);
|
if (match) {
|
||||||
if (addDirective(directives, nName, 'M', maxPriority)) {
|
nName = directiveNormalize(match[1]);
|
||||||
attrs[nName] = trim(match[2]);
|
if (addDirective(directives, nName, 'M', maxPriority)) {
|
||||||
|
attrs[nName] = trim(match[2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// turns out that under some circumstances IE9 throws errors when one attempts to read comment's node value.
|
||||||
|
// Just ignore it and continue. (Can't seem to reproduce in test case.)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue