From f17875e7e0a3e84d61adbeca7d54b068d63a4e84 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 26 Sep 2015 07:30:19 -0700 Subject: [PATCH] Properly classify "this" and "await" in isExpression --- src/compiler/utilities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9334ad58269..f85f5330ad9 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -897,7 +897,6 @@ namespace ts { export function isExpression(node: Node): boolean { switch (node.kind) { - case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: case SyntaxKind.NullKeyword: case SyntaxKind.TrueKeyword: @@ -930,6 +929,7 @@ namespace ts { case SyntaxKind.JsxElement: case SyntaxKind.JsxSelfClosingElement: case SyntaxKind.YieldExpression: + case SyntaxKind.AwaitExpression: return true; case SyntaxKind.QualifiedName: while (node.parent.kind === SyntaxKind.QualifiedName) { @@ -943,6 +943,7 @@ namespace ts { // fall through case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.ThisKeyword: let parent = node.parent; switch (parent.kind) { case SyntaxKind.VariableDeclaration: