angular/angular.js — pull request #5576 by sinelaw (2013-12-30 23:10:00+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