feat(compiler): type TemplateAst values as ASTWithSource (#35892)

TemplateAst values are currently typed as the base class AST, but they
are actually constructed with ASTWithSource. Type them as such, because
ASTWithSource gives more information about the consumed expression AST
to downstream customers (namely, the expression AST source).

Unblocks #35271

PR Close #35892
This commit is contained in:
Ayaz Hafiz
2020-03-05 19:41:47 -08:00
committed by Matias Niemelä
parent 0e2a577b42
commit 11f7e275e6
3 changed files with 18 additions and 15 deletions

View File

@ -691,7 +691,7 @@ export class ParsedEvent {
// Animation events have a phase
constructor(
public name: string, public targetOrPhase: string, public type: ParsedEventType,
public handler: AST, public sourceSpan: ParseSourceSpan,
public handler: ASTWithSource, public sourceSpan: ParseSourceSpan,
public handlerSpan: ParseSourceSpan) {}
}
@ -715,6 +715,6 @@ export const enum BindingType {
export class BoundElementProperty {
constructor(
public name: string, public type: BindingType, public securityContext: SecurityContext,
public value: AST, public unit: string|null, public sourceSpan: ParseSourceSpan,
public value: ASTWithSource, public unit: string|null, public sourceSpan: ParseSourceSpan,
public valueSpan?: ParseSourceSpan) {}
}