Skip to content

Commit 42318e7

Browse files
frost-cyalxhub
authored andcommitted
refactor(compiler-cli): move DelegatingPerfRecorder initialization into constructor (#54834)
Move the initialization of class field `DelegatingPerfRecorder` into the constructor. This fixes the error : `TypeError: Cannot read properties of undefined (reading 'eventCount')` This is blocking the roll-out of public class. PR Close #54834
1 parent 33dc072 commit 42318e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/compiler-cli/src/ngtsc/core/src/compiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export class NgCompiler {
279279
* `NgCompiler` use a `DelegatingPerfRecorder` so the `PerfRecorder` they write to can be updated
280280
* with each fresh compilation.
281281
*/
282-
private delegatingPerfRecorder = new DelegatingPerfRecorder(this.perfRecorder);
282+
private delegatingPerfRecorder: DelegatingPerfRecorder;
283283

284284
/**
285285
* Convert a `CompilationTicket` into an `NgCompiler` instance for the requested compilation.
@@ -334,6 +334,7 @@ export class NgCompiler {
334334
readonly usePoisonedData: boolean,
335335
private livePerfRecorder: ActivePerfRecorder,
336336
) {
337+
this.delegatingPerfRecorder = new DelegatingPerfRecorder(this.perfRecorder);
337338
this.enableTemplateTypeChecker =
338339
enableTemplateTypeChecker || (options['_enableTemplateTypeChecker'] ?? false);
339340
// TODO(crisbeto): remove this flag and base `enableBlockSyntax` on the `angularCoreVersion`.

0 commit comments

Comments
 (0)