@@ -310,26 +310,26 @@ function $CompileProvider($provide) {
310
310
311
311
//================================
312
312
313
- function compile ( $compileNode , transcludeFn , maxPriority ) {
314
- if ( ! ( $compileNode instanceof jqLite ) ) {
313
+ function compile ( $compileNodes , transcludeFn , maxPriority ) {
314
+ if ( ! ( $compileNodes instanceof jqLite ) ) {
315
315
// jquery always rewraps, where as we need to preserve the original selector so that we can modify it.
316
- $compileNode = jqLite ( $compileNode ) ;
316
+ $compileNodes = jqLite ( $compileNodes ) ;
317
317
}
318
318
// We can not compile top level text elements since text nodes can be merged and we will
319
319
// not be able to attach scope data to them, so we will wrap them in <span>
320
- forEach ( $compileNode , function ( node , index ) {
320
+ forEach ( $compileNodes , function ( node , index ) {
321
321
if ( node . nodeType == 3 /* text node */ ) {
322
- $compileNode [ index ] = jqLite ( node ) . wrap ( '<span></span>' ) . parent ( ) [ 0 ] ;
322
+ $compileNodes [ index ] = jqLite ( node ) . wrap ( '<span></span>' ) . parent ( ) [ 0 ] ;
323
323
}
324
324
} ) ;
325
- var compositeLinkFn = compileNodes ( $compileNode , transcludeFn , $compileNode , maxPriority ) ;
326
- return function ( scope , cloneConnectFn ) {
325
+ var compositeLinkFn = compileNodes ( $compileNodes , transcludeFn , $compileNodes , maxPriority ) ;
326
+ return function publicLinkFn ( scope , cloneConnectFn ) {
327
327
assertArg ( scope , 'scope' ) ;
328
328
// important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
329
329
// and sometimes changes the structure of the DOM.
330
330
var $linkNode = cloneConnectFn
331
- ? JQLitePrototype . clone . call ( $compileNode ) // IMPORTANT!!!
332
- : $compileNode ;
331
+ ? JQLitePrototype . clone . call ( $compileNodes ) // IMPORTANT!!!
332
+ : $compileNodes ;
333
333
$linkNode . data ( '$scope' , scope ) ;
334
334
safeAddClass ( $linkNode , 'ng-scope' ) ;
335
335
if ( cloneConnectFn ) cloneConnectFn ( $linkNode , scope ) ;
@@ -432,13 +432,14 @@ function $CompileProvider($provide) {
432
432
433
433
434
434
/**
435
- * Looks for directives on the given node ands them to the directive collection which is sorted.
435
+ * Looks for directives on the given node and adds them to the directive collection which is
436
+ * sorted.
436
437
*
437
- * @param node node to search
438
- * @param directives an array to which the directives are added to. This array is sorted before
438
+ * @param node Node to search.
439
+ * @param directives An array to which the directives are added to. This array is sorted before
439
440
* the function returns.
440
- * @param attrs the shared attrs object which is used to populate the normalized attributes.
441
- * @param {number= } max directive priority
441
+ * @param attrs The shared attrs object which is used to populate the normalized attributes.
442
+ * @param {number= } maxPriority Max directive priority.
442
443
*/
443
444
function collectDirectives ( node , directives , attrs , maxPriority ) {
444
445
var nodeType = node . nodeType ,
@@ -527,7 +528,7 @@ function $CompileProvider($provide) {
527
528
preLinkFns = [ ] ,
528
529
postLinkFns = [ ] ,
529
530
newScopeDirective = null ,
530
- newIsolatedScopeDirective = null ,
531
+ newIsolateScopeDirective = null ,
531
532
templateDirective = null ,
532
533
$compileNode = templateAttrs . $$element = jqLite ( compileNode ) ,
533
534
directive ,
@@ -549,10 +550,10 @@ function $CompileProvider($provide) {
549
550
}
550
551
551
552
if ( directiveValue = directive . scope ) {
552
- assertNoDuplicate ( 'isolated scope' , newIsolatedScopeDirective , directive , $compileNode ) ;
553
+ assertNoDuplicate ( 'isolated scope' , newIsolateScopeDirective , directive , $compileNode ) ;
553
554
if ( isObject ( directiveValue ) ) {
554
555
safeAddClass ( $compileNode , 'ng-isolate-scope' ) ;
555
- newIsolatedScopeDirective = directive ;
556
+ newIsolateScopeDirective = directive ;
556
557
}
557
558
safeAddClass ( $compileNode , 'ng-scope' ) ;
558
559
newScopeDirective = newScopeDirective || directive ;
@@ -706,12 +707,12 @@ function $CompileProvider($provide) {
706
707
}
707
708
$element = attrs . $$element ;
708
709
709
- if ( newIsolatedScopeDirective ) {
710
+ if ( newIsolateScopeDirective ) {
710
711
var LOCAL_REGEXP = / ^ \s * ( [ @ = & ] ) \s * ( \w * ) \s * $ / ;
711
712
712
713
var parentScope = scope . $parent || scope ;
713
714
714
- forEach ( newIsolatedScopeDirective . scope , function ( definiton , scopeName ) {
715
+ forEach ( newIsolateScopeDirective . scope , function ( definiton , scopeName ) {
715
716
var match = definiton . match ( LOCAL_REGEXP ) || [ ] ,
716
717
attrName = match [ 2 ] || scopeName ,
717
718
mode = match [ 1 ] , // @, =, or &
@@ -734,7 +735,7 @@ function $CompileProvider($provide) {
734
735
// reset the change, or we will throw this exception on every $digest
735
736
lastValue = scope [ scopeName ] = parentGet ( parentScope ) ;
736
737
throw Error ( NON_ASSIGNABLE_MODEL_EXPRESSION + attrs [ attrName ] +
737
- ' (directive: ' + newIsolatedScopeDirective . name + ')' ) ;
738
+ ' (directive: ' + newIsolateScopeDirective . name + ')' ) ;
738
739
} ;
739
740
lastValue = scope [ scopeName ] = parentGet ( parentScope ) ;
740
741
scope . $watch ( function parentValueWatch ( ) {
@@ -765,7 +766,7 @@ function $CompileProvider($provide) {
765
766
766
767
default : {
767
768
throw Error ( 'Invalid isolate scope definition for directive ' +
768
- newIsolatedScopeDirective . name + ': ' + definiton ) ;
769
+ newIsolateScopeDirective . name + ': ' + definiton ) ;
769
770
}
770
771
}
771
772
} ) ;
@@ -991,7 +992,7 @@ function $CompileProvider($provide) {
991
992
if ( interpolateFn ) {
992
993
directives . push ( {
993
994
priority : 0 ,
994
- compile : valueFn ( function ( scope , node ) {
995
+ compile : valueFn ( function textInterpolateLinkFn ( scope , node ) {
995
996
var parent = node . parent ( ) ,
996
997
bindings = parent . data ( '$binding' ) || [ ] ;
997
998
bindings . push ( interpolateFn ) ;
@@ -1014,7 +1015,7 @@ function $CompileProvider($provide) {
1014
1015
1015
1016
directives . push ( {
1016
1017
priority : 100 ,
1017
- compile : valueFn ( function ( scope , element , attr ) {
1018
+ compile : valueFn ( function attrInterpolateLinkFn ( scope , element , attr ) {
1018
1019
var $$observers = ( attr . $$observers || ( attr . $$observers = { } ) ) ;
1019
1020
1020
1021
if ( name === 'class' ) {
0 commit comments