Add cancellation token check for function expression, arrow expression and class expression just like their counter part declarations

This helps in early exit if request is cancelled and intellisense in js files is super quick with edits
This commit is contained in:
Sheetal Nandi 2019-08-13 11:40:00 -07:00
parent a35f7996a6
commit c52b129a19

View File

@ -25271,7 +25271,18 @@ namespace ts {
}
function checkExpressionWorker(node: Expression | QualifiedName, checkMode: CheckMode | undefined, forceTuple?: boolean): Type {
switch (node.kind) {
const kind = node.kind;
if (cancellationToken) {
// Only bother checking on a few construct kinds. We don't want to be excessively
// hitting the cancellation token on every node we check.
switch (kind) {
case SyntaxKind.ClassExpression:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
case SyntaxKind.Identifier:
return checkIdentifier(<Identifier>node);
case SyntaxKind.ThisKeyword: