Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(task): fix closure compatibility issue with ZoneDelegate._updateT…
Browse files Browse the repository at this point in the history
…askCount (#878)

onHasTask wasn't getting triggerred for the Angular Zone for setTimeout
when the application was closure compiled. This was causing errors with
Protractor not being able to wait for a closure compiled application using setTimeout.
  • Loading branch information
qiyigg authored and mhevery committed Aug 17, 2017
1 parent a66595a commit a03b84b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,16 +1123,16 @@ const Zone: ZoneType = (function(global: any) {

_updateTaskCount(type: TaskType, count: number) {
const counts = this._taskCounts;
const prev = (counts as any)[type];
const next = (counts as any)[type] = prev + count;
const prev = counts[type];
const next = counts[type] = prev + count;
if (next < 0) {
throw new Error('More tasks executed then were scheduled.');
}
if (prev == 0 || next == 0) {
const isEmpty: HasTaskState = {
microTask: counts.microTask > 0,
macroTask: counts.macroTask > 0,
eventTask: counts.eventTask > 0,
microTask: counts['microTask'] > 0,
macroTask: counts['macroTask'] > 0,
eventTask: counts['eventTask'] > 0,
change: type
};
this.hasTask(this.zone, isEmpty);
Expand Down

0 comments on commit a03b84b

Please sign in to comment.