feat(change_detection): ensure that expression do not change after they have been checked

This commit is contained in:
vsavkin
2014-12-04 18:30:54 -08:00
parent d02e192951
commit 8acf9fb609
11 changed files with 123 additions and 27 deletions

View File

@ -17,6 +17,10 @@ export class AST {
visit(visitor, args) {
}
toString():string {
return "AST";
}
}
export class EmptyExpr extends AST {
@ -378,13 +382,33 @@ export class FunctionCall extends AST {
}
}
export class ASTWithSource {
export class ASTWithSource extends AST {
ast:AST;
source:string;
constructor(ast:AST, source:string) {
this.source = source;
this.ast = ast;
}
eval(context) {
return this.ast.eval(context);
}
get isAssignable() {
return this.ast.isAssignable;
}
assign(context, value) {
return this.ast.assign(context, value);
}
visit(visitor, args) {
return this.ast.visit(visitor, args);
}
toString():string {
return this.source;
}
}
export class TemplateBinding {