From 7ae8ad6aabcb732cb0e04573a6f690b122b628e2 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 5 Jul 2017 10:20:02 -0700 Subject: [PATCH] fix(compiler): fix types --- packages/compiler/src/expression_parser/parser.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/compiler/src/expression_parser/parser.ts b/packages/compiler/src/expression_parser/parser.ts index 111a06e046..9503b0f64e 100644 --- a/packages/compiler/src/expression_parser/parser.ts +++ b/packages/compiler/src/expression_parser/parser.ts @@ -290,24 +290,24 @@ export class _ParseAST { this.error(`Missing expected operator ${operator}`); } - expectIdentifierOrKeyword(): string|null { + expectIdentifierOrKeyword(): string { const n = this.next; if (!n.isIdentifier() && !n.isKeyword()) { this.error(`Unexpected token ${n}, expected identifier or keyword`); return ''; } this.advance(); - return n.toString(); + return n.toString() as string; } - expectIdentifierOrKeywordOrString(): string|null { + expectIdentifierOrKeywordOrString(): string { const n = this.next; if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { this.error(`Unexpected token ${n}, expected identifier, keyword, or string`); return ''; } this.advance(); - return n.toString(); + return n.toString() as string; } parseChain(): AST { @@ -340,7 +340,7 @@ export class _ParseAST { } do { - const name = this.expectIdentifierOrKeyword() !; + const name = this.expectIdentifierOrKeyword(); const args: AST[] = []; while (this.optionalCharacter(chars.$COLON)) { args.push(this.parseExpression()); @@ -612,7 +612,7 @@ export class _ParseAST { if (!this.optionalCharacter(chars.$RBRACE)) { this.rbracesExpected++; do { - const key = this.expectIdentifierOrKeywordOrString() !; + const key = this.expectIdentifierOrKeywordOrString(); keys.push(key); this.expectCharacter(chars.$COLON); values.push(this.parsePipe()); @@ -625,7 +625,7 @@ export class _ParseAST { parseAccessMemberOrMethodCall(receiver: AST, isSafe: boolean = false): AST { const start = receiver.span.start; - const id = this.expectIdentifierOrKeyword() !; + const id = this.expectIdentifierOrKeyword(); if (this.optionalCharacter(chars.$LPAREN)) { this.rparensExpected++;