From da60381c8911323bf7b91d03394651043da8b016 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 10 Jun 2015 11:55:11 +0200 Subject: [PATCH] feat(AstTranformer): add support for missing nodes --- modules/angular2/src/change_detection/parser/ast.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/angular2/src/change_detection/parser/ast.ts b/modules/angular2/src/change_detection/parser/ast.ts index 8b425860c8..0aee6b9a48 100644 --- a/modules/angular2/src/change_detection/parser/ast.ts +++ b/modules/angular2/src/change_detection/parser/ast.ts @@ -410,11 +410,16 @@ export class AstTransformer implements AstVisitor { return res; } - visitChain(ast: Chain) { throw new BaseException('Not implemented'); } + visitChain(ast: Chain) { return new Chain(this.visitAll(ast.expressions)); } - visitAssignment(ast: Assignment) { throw new BaseException('Not implemented'); } + visitAssignment(ast: Assignment) { + return new Assignment(ast.target.visit(this), ast.value.visit(this)); + } - visitIf(ast: If) { throw new BaseException('Not implemented'); } + visitIf(ast: If) { + let falseExp = isPresent(ast.falseExp) ? ast.falseExp.visit(this) : null; + return new If(ast.condition.visit(this), ast.trueExp.visit(this), falseExp); + } } var _evalListCache = [