@@ -1141,7 +1141,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1141
1141
// We can not compile top level text elements since text nodes can be merged and we will
1142
1142
// not be able to attach scope data to them, so we will wrap them in <span>
1143
1143
forEach ( $compileNodes , function ( node , index ) {
1144
- if ( node . nodeType == 3 /* text node */ && node . nodeValue . match ( / \S + / ) /* non-empty */ ) {
1144
+ if ( node . nodeType == NODE_TYPE_TEXT && node . nodeValue . match ( / \S + / ) /* non-empty */ ) {
1145
1145
$compileNodes [ index ] = jqLite ( node ) . wrap ( '<span></span>' ) . parent ( ) [ 0 ] ;
1146
1146
}
1147
1147
} ) ;
@@ -1344,7 +1344,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1344
1344
className ;
1345
1345
1346
1346
switch ( nodeType ) {
1347
- case 1 : /* Element */
1347
+ case NODE_TYPE_ELEMENT : /* Element */
1348
1348
// use the node name: <directive>
1349
1349
addDirective ( directives ,
1350
1350
directiveNormalize ( nodeName_ ( node ) ) , 'E' , maxPriority , ignoreDirective ) ;
@@ -1399,10 +1399,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1399
1399
}
1400
1400
}
1401
1401
break ;
1402
- case 3 : /* Text Node */
1402
+ case NODE_TYPE_TEXT : /* Text Node */
1403
1403
addTextInterpolateDirective ( directives , node . nodeValue ) ;
1404
1404
break ;
1405
- case 8 : /* Comment */
1405
+ case NODE_TYPE_COMMENT : /* Comment */
1406
1406
try {
1407
1407
match = COMMENT_DIRECTIVE_REGEXP . exec ( node . nodeValue ) ;
1408
1408
if ( match ) {
@@ -1442,7 +1442,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1442
1442
"Unterminated attribute, found '{0}' but no matching '{1}' found." ,
1443
1443
attrStart , attrEnd ) ;
1444
1444
}
1445
- if ( node . nodeType == 1 /** Element **/ ) {
1445
+ if ( node . nodeType == NODE_TYPE_ELEMENT ) {
1446
1446
if ( node . hasAttribute ( attrStart ) ) depth ++ ;
1447
1447
if ( node . hasAttribute ( attrEnd ) ) depth -- ;
1448
1448
}
@@ -1625,7 +1625,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1625
1625
}
1626
1626
compileNode = $template [ 0 ] ;
1627
1627
1628
- if ( $template . length != 1 || compileNode . nodeType !== 1 ) {
1628
+ if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
1629
1629
throw $compileMinErr ( 'tplrt' ,
1630
1630
"Template for directive '{0}' must have exactly one root element. {1}" ,
1631
1631
directiveName , '' ) ;
@@ -2107,7 +2107,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2107
2107
}
2108
2108
compileNode = $template [ 0 ] ;
2109
2109
2110
- if ( $template . length != 1 || compileNode . nodeType !== 1 ) {
2110
+ if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2111
2111
throw $compileMinErr ( 'tplrt' ,
2112
2112
"Template for directive '{0}' must have exactly one root element. {1}" ,
2113
2113
origAsyncDirective . name , templateUrl ) ;
@@ -2533,7 +2533,7 @@ function removeComments(jqNodes) {
2533
2533
2534
2534
while ( i -- ) {
2535
2535
var node = jqNodes [ i ] ;
2536
- if ( node . nodeType === 8 ) {
2536
+ if ( node . nodeType === NODE_TYPE_COMMENT ) {
2537
2537
splice . call ( jqNodes , i , 1 ) ;
2538
2538
}
2539
2539
}
0 commit comments