refactor(zone.js): Change the type of _taskCounts to an IndexSignature that can have keys (#51739)

named as the values of the `TaskType` type.

The Closure Compiler used at Google has a property renaming optimization
that can change the property names when minifying code. Having the
correct type helps the TSJS team that develops a tool to identfy
property renaming issues directly in TypeScript.

Signed-off-by: Costin Sin <sin.costinrobert@gmail.com>

PR Close #51739
This commit is contained in:
Costin Sin 2024-09-24 09:32:10 +03:00 committed by Jessica Janiuk
parent f87a773278
commit efa7baa976

View file

@ -1128,7 +1128,7 @@ export function initZone(): ZoneType {
}
private _zone: ZoneImpl;
private _taskCounts: {microTask: number; macroTask: number; eventTask: number} = {
private _taskCounts: {[key in TaskType]: number} = {
'microTask': 0,
'macroTask': 0,
'eventTask': 0,