When an emitted Ivy definition eagerly references a const declared after the class, OXC leaves the const in place, producing a temporal-dead-zone ReferenceError at module load.
Repro
import { Component } from '@angular/core';
@Component({ selector: 'x', template: '', providers: [{ provide: TOKEN, useValue: 1 }] })
export class TestComponent {}
const TOKEN = 'tok';
Actual
TOKEN stays after the class; ɵcmp's ɵɵProvidersFeature evaluates eagerly in the class body → ReferenceError: Cannot access 'TOKEN' before initialization.
Expected
Angular hoists consts that emitted definitions depend on above the class declaration.
Impact
Hard runtime crash at module evaluation.
Researched and drafted with Claude Code.
When an emitted Ivy definition eagerly references a
constdeclared after the class, OXC leaves the const in place, producing a temporal-dead-zoneReferenceErrorat module load.Repro
Actual
TOKENstays after the class;ɵcmp'sɵɵProvidersFeatureevaluates eagerly in the class body →ReferenceError: Cannot access 'TOKEN' before initialization.Expected
Angular hoists consts that emitted definitions depend on above the class declaration.
Impact
Hard runtime crash at module evaluation.
Researched and drafted with Claude Code.