Improve error recovery after a dot

This commit is contained in:
Jason Freeman
2015-06-09 18:09:14 -07:00
parent d8151fbd91
commit 10fccc578e
5 changed files with 66 additions and 1 deletions

View File

@@ -1807,7 +1807,7 @@ module ts {
// the code would be implicitly: "name.keyword; identifierNameOrKeyword".
// In the first case though, ASI will not take effect because there is not a
// line terminator after the keyword.
if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) {
if (scanner.hasPrecedingLineBreak() && isIdentifierOrKeyword()) {
let matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
if (matchesPattern) {