Skip to content

Commit da60381

Browse files
committed
feat(AstTranformer): add support for missing nodes
1 parent 7d32879 commit da60381

File tree

1 file changed

+8
-3
lines changed
  • modules/angular2/src/change_detection/parser

1 file changed

+8
-3
lines changed

modules/angular2/src/change_detection/parser/ast.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,16 @@ export class AstTransformer implements AstVisitor {
410410
return res;
411411
}
412412

413-
visitChain(ast: Chain) { throw new BaseException('Not implemented'); }
413+
visitChain(ast: Chain) { return new Chain(this.visitAll(ast.expressions)); }
414414

415-
visitAssignment(ast: Assignment) { throw new BaseException('Not implemented'); }
415+
visitAssignment(ast: Assignment) {
416+
return new Assignment(ast.target.visit(this), ast.value.visit(this));
417+
}
416418

417-
visitIf(ast: If) { throw new BaseException('Not implemented'); }
419+
visitIf(ast: If) {
420+
let falseExp = isPresent(ast.falseExp) ? ast.falseExp.visit(this) : null;
421+
return new If(ast.condition.visit(this), ast.trueExp.visit(this), falseExp);
422+
}
418423
}
419424

420425
var _evalListCache = [

0 commit comments

Comments
 (0)