File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,6 @@ function $RootScopeProvider(){
195
195
child [ 'this' ] = child ;
196
196
child . $$listeners = { } ;
197
197
child . $parent = this ;
198
- child . $$asyncQueue = [ ] ;
199
198
child . $$watchers = child . $$nextSibling = child . $$childHead = child . $$childTail = null ;
200
199
child . $$prevSibling = this . $$childTail ;
201
200
if ( this . $$childHead ) {
@@ -362,7 +361,7 @@ function $RootScopeProvider(){
362
361
$digest : function ( ) {
363
362
var watch , value , last ,
364
363
watchers ,
365
- asyncQueue ,
364
+ asyncQueue = this . $$asyncQueue ,
366
365
length ,
367
366
dirty , ttl = TTL ,
368
367
next , current , target = this ,
@@ -371,18 +370,19 @@ function $RootScopeProvider(){
371
370
372
371
beginPhase ( '$digest' ) ;
373
372
374
- do {
373
+ do { // "while dirty" loop
375
374
dirty = false ;
376
375
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 ) ;
385
382
}
383
+ }
384
+
385
+ do { // "traverse the scopes" loop
386
386
if ( ( watchers = current . $$watchers ) ) {
387
387
// process our watches
388
388
length = watchers . length ;
Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ describe('Scope', function() {
441
441
child . $evalAsync ( function ( scope ) { log += 'child.async;' ; } ) ;
442
442
child . $watch ( 'value' , function ( ) { log += 'child.$digest;' ; } ) ;
443
443
$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;' ) ;
445
445
} ) ) ;
446
446
447
447
it ( 'should cause a $digest rerun' , inject ( function ( $rootScope ) {
You can’t perform that action at this time.
0 commit comments