angular/angular.js — pull request #5578 by sinelaw (2013-12-31 01:13:07+00:00)
Title: fix($rootScope): prevent infinite $digest loop by also checking if asyncQueue is empty when decrementing ttl

An infinite $digest loop can be caused by expressions that invoke a promise. The problem is that $digest does not
decrement ttl unless it finds dirty changes; it should check also if asyncQueue is empty.
Generally the condition for decrementing ttl should be the same as the condition for terminating the $digest loop.

Closes #2622