mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-25 18:50:29 -06:00
Don't check function expression grammar if this is SkipContextSensitive (#17698)
This commit is contained in:
parent
6221d7089e
commit
f28f5fd041
@ -16851,18 +16851,18 @@ namespace ts {
|
||||
function checkFunctionExpressionOrObjectLiteralMethod(node: FunctionExpression | MethodDeclaration, checkMode?: CheckMode): Type {
|
||||
Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node));
|
||||
|
||||
// Grammar checking
|
||||
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
|
||||
if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) {
|
||||
checkGrammarForGenerator(node);
|
||||
}
|
||||
|
||||
// The identityMapper object is used to indicate that function expressions are wildcards
|
||||
if (checkMode === CheckMode.SkipContextSensitive && isContextSensitive(node)) {
|
||||
checkNodeDeferred(node);
|
||||
return anyFunctionType;
|
||||
}
|
||||
|
||||
// Grammar checking
|
||||
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
|
||||
if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) {
|
||||
checkGrammarForGenerator(node);
|
||||
}
|
||||
|
||||
const links = getNodeLinks(node);
|
||||
const type = getTypeOfSymbol(node.symbol);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user