fix(ivy): handle ReadKeyExpr code generation (#24862)

This implements a missing expression type in ngtsc code generation:
that of bracket access to an object property.

PR Close #24862
This commit is contained in:
Alex Rickabaugh 2018-07-03 14:09:56 -07:00 committed by Victor Berchet
parent bb58138579
commit f58f3dc07a
1 changed files with 3 additions and 2 deletions

View File

@ -237,8 +237,9 @@ class ExpressionTranslatorVisitor implements ExpressionVisitor, StatementVisitor
return ts.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
}
visitReadKeyExpr(ast: ReadKeyExpr, context: any): never {
throw new Error('Method not implemented.');
visitReadKeyExpr(ast: ReadKeyExpr, context: any): ts.ElementAccessExpression {
return ts.createElementAccess(
ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
}
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): ts.ArrayLiteralExpression {