From efa7baa97614bbef80217306777b0567236fa8ef Mon Sep 17 00:00:00 2001 From: Costin Sin Date: Tue, 24 Sep 2024 09:32:10 +0300 Subject: [PATCH] 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 PR Close #51739 --- packages/zone.js/lib/zone-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zone.js/lib/zone-impl.ts b/packages/zone.js/lib/zone-impl.ts index d943fcff7c5..9b47fa2b2e7 100644 --- a/packages/zone.js/lib/zone-impl.ts +++ b/packages/zone.js/lib/zone-impl.ts @@ -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,