Skip to content

Commit f28f5fd

Browse files
author
Andy
authored
Don't check function expression grammar if this is SkipContextSensitive (microsoft#17698)
1 parent 6221d70 commit f28f5fd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/compiler/checker.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16851,18 +16851,18 @@ namespace ts {
1685116851
function checkFunctionExpressionOrObjectLiteralMethod(node: FunctionExpression | MethodDeclaration, checkMode?: CheckMode): Type {
1685216852
Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node));
1685316853

16854-
// Grammar checking
16855-
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
16856-
if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) {
16857-
checkGrammarForGenerator(node);
16858-
}
16859-
1686016854
// The identityMapper object is used to indicate that function expressions are wildcards
1686116855
if (checkMode === CheckMode.SkipContextSensitive && isContextSensitive(node)) {
1686216856
checkNodeDeferred(node);
1686316857
return anyFunctionType;
1686416858
}
1686516859

16860+
// Grammar checking
16861+
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
16862+
if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) {
16863+
checkGrammarForGenerator(node);
16864+
}
16865+
1686616866
const links = getNodeLinks(node);
1686716867
const type = getTypeOfSymbol(node.symbol);
1686816868

0 commit comments

Comments
 (0)