@@ -130,11 +130,8 @@ function $RootScopeProvider(){
130130 this . $$childHead = this . $$childTail = null ;
131131 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.
@@ -692,8 +686,6 @@ function $RootScopeProvider(){
692686 $digest : function ( ) {
693687 var watch , value , last ,
694688 watchers ,
695- asyncQueue = this . $$asyncQueue ,
696- postDigestQueue = this . $$postDigestQueue ,
697689 length ,
698690 dirty , ttl = TTL ,
699691 next , current , target = this ,
@@ -870,9 +862,6 @@ function $RootScopeProvider(){
870862 this . $parent = this . $$nextSibling = this . $$prevSibling = this . $$childHead =
871863 this . $$childTail = this . $root = this . $$watchers = this . $$listeners = null ;
872864
873- // don't reset these to null in case some async task tries to register a listener/watch/task
874- this . $$asyncQueue = this . $$postDigestQueue = [ ] ;
875-
876865 // prevent NPEs since these methods have references to properties we nulled out
877866 this . $destroy = this . $digest = this . $apply = noop ;
878867 this . $on = this . $watch = this . $watchGroup = function ( ) { return noop ; } ;
@@ -942,19 +931,19 @@ function $RootScopeProvider(){
942931 $evalAsync : function ( expr ) {
943932 // if we are outside of an $digest loop and this is the first time we are scheduling async
944933 // task also schedule async auto-flush
945- if ( ! $rootScope . $$phase && ! $rootScope . $$ asyncQueue. length ) {
934+ if ( ! $rootScope . $$phase && ! asyncQueue . length ) {
946935 $browser . defer ( function ( ) {
947- if ( $rootScope . $$ asyncQueue. length ) {
936+ if ( asyncQueue . length ) {
948937 $rootScope . $digest ( ) ;
949938 }
950939 } ) ;
951940 }
952941
953- this . $$ asyncQueue. push ( { scope : this , expression : expr } ) ;
942+ asyncQueue . push ( { scope : this , expression : expr } ) ;
954943 } ,
955944
956945 $$postDigest : function ( fn ) {
957- this . $$ postDigestQueue. push ( fn ) ;
946+ postDigestQueue . push ( fn ) ;
958947 } ,
959948
960949 /**
@@ -1038,7 +1027,7 @@ function $RootScopeProvider(){
10381027 */
10391028 $applyAsync : function ( expr ) {
10401029 var scope = this ;
1041- expr && $rootScope . $$ applyAsyncQueue. push ( $applyAsyncExpression ) ;
1030+ expr && applyAsyncQueue . push ( $applyAsyncExpression ) ;
10421031 scheduleApplyAsync ( ) ;
10431032
10441033 function $applyAsyncExpression ( ) {
@@ -1250,6 +1239,10 @@ function $RootScopeProvider(){
12501239
12511240 var $rootScope = new Scope ( ) ;
12521241
1242+ var asyncQueue = [ ] ;
1243+ var postDigestQueue = [ ] ;
1244+ var applyAsyncQueue = [ ] ;
1245+
12531246 return $rootScope ;
12541247
12551248
@@ -1283,10 +1276,9 @@ function $RootScopeProvider(){
12831276 function initWatchVal ( ) { }
12841277
12851278 function flushApplyAsync ( ) {
1286- var queue = $rootScope . $$applyAsyncQueue ;
1287- while ( queue . length ) {
1279+ while ( applyAsyncQueue . length ) {
12881280 try {
1289- queue . shift ( ) ( ) ;
1281+ applyAsyncQueue . shift ( ) ( ) ;
12901282 } catch ( e ) {
12911283 $exceptionHandler ( e ) ;
12921284 }
0 commit comments