From f28f5fd0412ec7c6c08c3ee214232a8db68a372c Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 14:09:52 -0700 Subject: [PATCH] Don't check function expression grammar if this is SkipContextSensitive (#17698) --- src/compiler/checker.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1d1d16b7ee1..f6ceab48ae8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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);