changeDetectionStrategyToConst function

Expression changeDetectionStrategyToConst(
  1. int value
)

Converts value of a ChangeDetectionStrategy to refer to the static field.

Otherwise the generated code refers to arbitrary integer values.

Implementation

o.Expression changeDetectionStrategyToConst(int value) {
  final name = _changeDetectionStrategies[value];
  return o.importExpr(CompileIdentifierMetadata(
    name: 'ChangeDetectionStrategy.$name',
    moduleUrl: Identifiers.ChangeDetectionStrategy.moduleUrl,
  ));
}