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

Commit a03b84b

Browse files
qiyiggmhevery
authored andcommitted
fix(task): fix closure compatibility issue with ZoneDelegate._updateTaskCount (#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.
1 parent a66595a commit a03b84b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/zone.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1123,16 +1123,16 @@ const Zone: ZoneType = (function(global: any) {
11231123

11241124
_updateTaskCount(type: TaskType, count: number) {
11251125
const counts = this._taskCounts;
1126-
const prev = (counts as any)[type];
1127-
const next = (counts as any)[type] = prev + count;
1126+
const prev = counts[type];
1127+
const next = counts[type] = prev + count;
11281128
if (next < 0) {
11291129
throw new Error('More tasks executed then were scheduled.');
11301130
}
11311131
if (prev == 0 || next == 0) {
11321132
const isEmpty: HasTaskState = {
1133-
microTask: counts.microTask > 0,
1134-
macroTask: counts.macroTask > 0,
1135-
eventTask: counts.eventTask > 0,
1133+
microTask: counts['microTask'] > 0,
1134+
macroTask: counts['macroTask'] > 0,
1135+
eventTask: counts['eventTask'] > 0,
11361136
change: type
11371137
};
11381138
this.hasTask(this.zone, isEmpty);

0 commit comments

Comments
 (0)