File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,6 @@ function $RootScopeProvider(){
195195 child [ 'this' ] = child ;
196196 child . $$listeners = { } ;
197197 child . $parent = this ;
198- child . $$asyncQueue = [ ] ;
199198 child . $$watchers = child . $$nextSibling = child . $$childHead = child . $$childTail = null ;
200199 child . $$prevSibling = this . $$childTail ;
201200 if ( this . $$childHead ) {
@@ -362,7 +361,7 @@ function $RootScopeProvider(){
362361 $digest : function ( ) {
363362 var watch , value , last ,
364363 watchers ,
365- asyncQueue ,
364+ asyncQueue = this . $$asyncQueue ,
366365 length ,
367366 dirty , ttl = TTL ,
368367 next , current , target = this ,
@@ -371,18 +370,19 @@ function $RootScopeProvider(){
371370
372371 beginPhase ( '$digest' ) ;
373372
374- do {
373+ do { // "while dirty" loop
375374 dirty = false ;
376375 current = target ;
377- do {
378- asyncQueue = current . $$asyncQueue ;
379- while ( asyncQueue . length ) {
380- try {
381- current . $eval ( asyncQueue . shift ( ) ) ;
382- } catch ( e ) {
383- $exceptionHandler ( e ) ;
384- }
376+
377+ while ( asyncQueue . length ) {
378+ try {
379+ current . $eval ( asyncQueue . shift ( ) ) ;
380+ } catch ( e ) {
381+ $exceptionHandler ( e ) ;
385382 }
383+ }
384+
385+ do { // "traverse the scopes" loop
386386 if ( ( watchers = current . $$watchers ) ) {
387387 // process our watches
388388 length = watchers . length ;
Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ describe('Scope', function() {
441441 child . $evalAsync ( function ( scope ) { log += 'child.async;' ; } ) ;
442442 child . $watch ( 'value' , function ( ) { log += 'child.$digest;' ; } ) ;
443443 $rootScope . $digest ( ) ;
444- expect ( log ) . toEqual ( 'parent.async;parent.$digest;child.async ;child.$digest;' ) ;
444+ expect ( log ) . toEqual ( 'parent.async;child.async; parent.$digest;child.$digest;' ) ;
445445 } ) ) ;
446446
447447 it ( 'should cause a $digest rerun' , inject ( function ( $rootScope ) {
You can’t perform that action at this time.
0 commit comments