feat(ivy): include value spans for attributes, variables and references (#30181)

Template AST nodes for (bound) attributes, variables and references will
now retain a reference to the source span of their value, which allows
for more accurate type check diagnostics.

PR Close #30181
This commit is contained in:
JoostK
2019-05-04 22:41:17 +02:00
committed by Miško Hevery
parent 985513351b
commit 489cef6ea2
8 changed files with 395 additions and 61 deletions

View File

@ -691,7 +691,7 @@ export class ParsedProperty {
constructor(
public name: string, public expression: ASTWithSource, public type: ParsedPropertyType,
public sourceSpan: ParseSourceSpan) {
public sourceSpan: ParseSourceSpan, public valueSpan?: ParseSourceSpan) {
this.isLiteral = this.type === ParsedPropertyType.LITERAL_ATTR;
this.isAnimation = this.type === ParsedPropertyType.ANIMATION;
}
@ -739,5 +739,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: AST, public unit: string|null, public sourceSpan: ParseSourceSpan,
public valueSpan?: ParseSourceSpan) {}
}