mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 17:41:26 -06:00
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:
parent
a35f7996a6
commit
c52b129a19
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user