Add assertions

This commit is contained in:
Mohamed Hegazy 2018-05-29 09:06:16 -07:00
parent af0c4ce6a1
commit 4683cb5bad

View File

@ -52,8 +52,8 @@ function walk(ctx: Lint.WalkContext<void>, checkCatch: boolean, checkElse: boole
return;
}
const tryClosingBrace = tryBlock.getLastToken(sourceFile);
const catchKeyword = catchClause.getFirstToken(sourceFile);
const tryClosingBrace = tryBlock.getLastToken(sourceFile)!;
const catchKeyword = catchClause.getFirstToken(sourceFile)!;
const tryClosingBraceLoc = sourceFile.getLineAndCharacterOfPosition(tryClosingBrace.getEnd());
const catchKeywordLoc = sourceFile.getLineAndCharacterOfPosition(catchKeyword.getStart(sourceFile));
if (tryClosingBraceLoc.line === catchKeywordLoc.line) {