Fix #9531: account for async as an contextual keyword when parsing export assignments

This commit is contained in:
Mohamed Hegazy
2016-07-06 14:08:21 -07:00
parent 230c9cfbe7
commit bf240d2c69
5 changed files with 200 additions and 1 deletions

View File

@@ -1184,7 +1184,8 @@ namespace ts {
function nextTokenIsClassOrFunctionOrAsync(): boolean {
nextToken();
return token === SyntaxKind.ClassKeyword || token === SyntaxKind.FunctionKeyword || token === SyntaxKind.AsyncKeyword;
return token === SyntaxKind.ClassKeyword || token === SyntaxKind.FunctionKeyword ||
(token === SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
// True if positioned at the start of a list element