Scan types of yield expressions in classes too

Also, drop the other cases where they were ignored, since they're
forbidden in enums, and the others are fine wrt the comment that was
there.

Fixes #34892
This commit is contained in:
Eli Barzilay
2019-11-14 14:10:17 -05:00
parent 20b246c83a
commit f017fa04c4
9 changed files with 9 additions and 12 deletions

View File

@@ -1221,11 +1221,8 @@ namespace ts {
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ClassExpression:
// These are not allowed inside a generator now, but eventually they may be allowed
// as local types. Regardless, any yield statements contained within them should be
// skipped in this traversal.
// as local types. Regardless, skip them to avoid the work.
return;
default:
if (isFunctionLike(node)) {