refactor(core): remove readonly getters in common, compiler (#19150)
PR Close #19150
This commit is contained in:
@ -36,13 +36,15 @@ export enum BoundPropertyType {
|
||||
* Represents a parsed property.
|
||||
*/
|
||||
export class BoundProperty {
|
||||
public readonly isLiteral: boolean;
|
||||
public readonly isAnimation: boolean;
|
||||
|
||||
constructor(
|
||||
public name: string, public expression: ASTWithSource, public type: BoundPropertyType,
|
||||
public sourceSpan: ParseSourceSpan) {}
|
||||
|
||||
get isLiteral() { return this.type === BoundPropertyType.LITERAL_ATTR; }
|
||||
|
||||
get isAnimation() { return this.type === BoundPropertyType.ANIMATION; }
|
||||
public sourceSpan: ParseSourceSpan) {
|
||||
this.isLiteral = this.type === BoundPropertyType.LITERAL_ATTR;
|
||||
this.isAnimation = this.type === BoundPropertyType.ANIMATION;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,14 +63,17 @@ export class AttrAst implements TemplateAst {
|
||||
* `[@trigger]="stateExp"`)
|
||||
*/
|
||||
export class BoundElementPropertyAst implements TemplateAst {
|
||||
public readonly isAnimation: boolean;
|
||||
|
||||
constructor(
|
||||
public name: string, public type: PropertyBindingType,
|
||||
public securityContext: SecurityContext, public value: AST, public unit: string|null,
|
||||
public sourceSpan: ParseSourceSpan) {}
|
||||
public sourceSpan: ParseSourceSpan) {
|
||||
this.isAnimation = this.type === PropertyBindingType.Animation;
|
||||
}
|
||||
visit(visitor: TemplateAstVisitor, context: any): any {
|
||||
return visitor.visitElementProperty(this, context);
|
||||
}
|
||||
get isAnimation(): boolean { return this.type === PropertyBindingType.Animation; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,14 +91,18 @@ export class BoundEventAst implements TemplateAst {
|
||||
}
|
||||
}
|
||||
|
||||
public readonly fullName: string;
|
||||
public readonly isAnimation: boolean;
|
||||
|
||||
constructor(
|
||||
public name: string, public target: string|null, public phase: string|null,
|
||||
public handler: AST, public sourceSpan: ParseSourceSpan) {}
|
||||
public handler: AST, public sourceSpan: ParseSourceSpan) {
|
||||
this.fullName = BoundEventAst.calcFullName(this.name, this.target, this.phase);
|
||||
this.isAnimation = !!this.phase;
|
||||
}
|
||||
visit(visitor: TemplateAstVisitor, context: any): any {
|
||||
return visitor.visitEvent(this, context);
|
||||
}
|
||||
get fullName() { return BoundEventAst.calcFullName(this.name, this.target, this.phase); }
|
||||
get isAnimation(): boolean { return !!this.phase; }
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user