@@ -130,11 +130,8 @@ function $RootScopeProvider(){
130130 this . $$childHead = this . $$childTail = null ;
131131 this [ 'this' ] = this . $root = this ;
132132 this . $$destroyed = false ;
133- this . $$asyncQueue = [ ] ;
134- this . $$postDigestQueue = [ ] ;
135133 this . $$listeners = this . $$listenerCount = null ;
136134 this . $$isolateBindings = null ;
137- this . $$applyAsyncQueue = [ ] ;
138135 }
139136
140137 /**
@@ -192,9 +189,6 @@ function $RootScopeProvider(){
192189 if ( isolate ) {
193190 child = new Scope ( ) ;
194191 child . $root = this . $root ;
195- // ensure that there is just one async queue per $rootScope and its children
196- child . $$asyncQueue = this . $$asyncQueue ;
197- child . $$postDigestQueue = this . $$postDigestQueue ;
198192 } else {
199193 // Only create a child scope class if somebody asks for one,
200194 // but cache it to allow the VM to optimize lookups.
@@ -693,8 +687,6 @@ function $RootScopeProvider(){
693687 $digest : function ( ) {
694688 var watch , value , last ,
695689 watchers ,
696- asyncQueue = this . $$asyncQueue ,
697- postDigestQueue = this . $$postDigestQueue ,
698690 length ,
699691 dirty , ttl = TTL ,
700692 next , current , target = this ,
@@ -871,9 +863,6 @@ function $RootScopeProvider(){
871863 this . $parent = this . $$nextSibling = this . $$prevSibling = this . $$childHead =
872864 this . $$childTail = this . $root = this . $$watchers = this . $$listeners = null ;
873865
874- // don't reset these to null in case some async task tries to register a listener/watch/task
875- this . $$asyncQueue = this . $$postDigestQueue = [ ] ;
876-
877866 // prevent NPEs since these methods have references to properties we nulled out
878867 this . $destroy = this . $digest = this . $apply = noop ;
879868 this . $on = this . $watch = this . $watchGroup = function ( ) { return noop ; } ;
@@ -943,19 +932,19 @@ function $RootScopeProvider(){
943932 $evalAsync : function ( expr ) {
944933 // if we are outside of an $digest loop and this is the first time we are scheduling async
945934 // task also schedule async auto-flush
946- if ( ! $rootScope . $$phase && ! $rootScope . $$ asyncQueue. length ) {
935+ if ( ! $rootScope . $$phase && ! asyncQueue . length ) {
947936 $browser . defer ( function ( ) {
948- if ( $rootScope . $$ asyncQueue. length ) {
937+ if ( asyncQueue . length ) {
949938 $rootScope . $digest ( ) ;
950939 }
951940 } ) ;
952941 }
953942
954- this . $$ asyncQueue. push ( { scope : this , expression : expr } ) ;
943+ asyncQueue . push ( { scope : this , expression : expr } ) ;
955944 } ,
956945
957946 $$postDigest : function ( fn ) {
958- this . $$ postDigestQueue. push ( fn ) ;
947+ postDigestQueue . push ( fn ) ;
959948 } ,
960949
961950 /**
@@ -1039,7 +1028,7 @@ function $RootScopeProvider(){
10391028 */
10401029 $applyAsync : function ( expr ) {
10411030 var scope = this ;
1042- expr && $rootScope . $$ applyAsyncQueue. push ( $applyAsyncExpression ) ;
1031+ expr && applyAsyncQueue . push ( $applyAsyncExpression ) ;
10431032 scheduleApplyAsync ( ) ;
10441033
10451034 function $applyAsyncExpression ( ) {
@@ -1251,6 +1240,10 @@ function $RootScopeProvider(){
12511240
12521241 var $rootScope = new Scope ( ) ;
12531242
1243+ var asyncQueue = [ ] ;
1244+ var postDigestQueue = [ ] ;
1245+ var applyAsyncQueue = [ ] ;
1246+
12541247 return $rootScope ;
12551248
12561249
@@ -1284,10 +1277,9 @@ function $RootScopeProvider(){
12841277 function initWatchVal ( ) { }
12851278
12861279 function flushApplyAsync ( ) {
1287- var queue = $rootScope . $$applyAsyncQueue ;
1288- while ( queue . length ) {
1280+ while ( applyAsyncQueue . length ) {
12891281 try {
1290- queue . shift ( ) ( ) ;
1282+ applyAsyncQueue . shift ( ) ( ) ;
12911283 } catch ( e ) {
12921284 $exceptionHandler ( e ) ;
12931285 }
0 commit comments