File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25271,7 +25271,18 @@ namespace ts {
25271
25271
}
25272
25272
25273
25273
function checkExpressionWorker(node: Expression | QualifiedName, checkMode: CheckMode | undefined, forceTuple?: boolean): Type {
25274
- switch (node.kind) {
25274
+ const kind = node.kind;
25275
+ if (cancellationToken) {
25276
+ // Only bother checking on a few construct kinds. We don't want to be excessively
25277
+ // hitting the cancellation token on every node we check.
25278
+ switch (kind) {
25279
+ case SyntaxKind.ClassExpression:
25280
+ case SyntaxKind.FunctionExpression:
25281
+ case SyntaxKind.ArrowFunction:
25282
+ cancellationToken.throwIfCancellationRequested();
25283
+ }
25284
+ }
25285
+ switch (kind) {
25275
25286
case SyntaxKind.Identifier:
25276
25287
return checkIdentifier(<Identifier>node);
25277
25288
case SyntaxKind.ThisKeyword:
You can’t perform that action at this time.
0 commit comments