nl_tokens: @ngdoc method @name $rootScope . Scope#$watchGroup @kind function
pl_tokens: function ( watchExpressions , listener ) { var oldValues = new Array ( watchExpressions . length ) ; var newValues = new Array ( watchExpressions . length ) ; var deregisterFns = [ ] ; var self = this ; var changeReactionScheduled = false ; var firstRun = true ; if ( ! watchExpressions . length ) { // No expressions means we call the listener ASAP var shouldCall = true ; self . $evalAsync ( function ( ) { if ( shouldCall ) listener ( newValues , newValues , self ) ; } ) ; return function deregisterWatchGroup ( ) { shouldCall = false ; } ; } if ( watchExpressions . length === 1 ) { // Special case size of one return this . $watch ( watchExpressions [ 0 ] , function watchGroupAction ( value , oldValue , scope ) { newValues [ 0 ] = value ; oldValues [ 0 ] = oldValue ; listener ( newValues , ( value === oldValue ) ? newValues : oldValues , <mask> ) ; } ) ; } forEach ( watchExpressions , function ( expr , i ) { var unwatchFn = self . $watch ( expr , function watchGroupSubAction ( value ) { newValues [ i ] = value ; if ( ! changeReactionScheduled ) { changeReactionScheduled = true ; self . $evalAsync ( watchGroupAction ) ; } } ) ; deregisterFns . push ( unwatchFn ) ; } ) ; function watchGroupAction ( ) { changeReactionScheduled = false ; try { if ( firstRun ) { firstRun = false ; listener ( newValues , newValues , self ) ; } else { listener ( newValues , oldValues , self ) ; } } finally { for ( var i = 0 ; i < watchExpressions . length ; i ++ ) { oldValues [ i ] = newValues [ i ] ; } } } return function deregisterWatchGroup ( ) { while ( deregisterFns . length ) { deregisterFns . shift ( ) ( ) ; } } ; }