Skip to content

Commit acb9f70

Browse files
committed
Fix occurrences in ClassExpressions
1 parent 649e40b commit acb9f70

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/services.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4682,12 +4682,13 @@ namespace ts {
46824682
// Make sure we only highlight the keyword when it makes sense to do so.
46834683
if (isAccessibilityModifier(modifier)) {
46844684
if (!(container.kind === SyntaxKind.ClassDeclaration ||
4685+
container.kind === SyntaxKind.ClassExpression ||
46854686
(declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) {
46864687
return undefined;
46874688
}
46884689
}
46894690
else if (modifier === SyntaxKind.StaticKeyword) {
4690-
if (container.kind !== SyntaxKind.ClassDeclaration) {
4691+
if (!(container.kind === SyntaxKind.ClassDeclaration || container.kind === SyntaxKind.ClassExpression)) {
46914692
return undefined;
46924693
}
46934694
}
@@ -4726,12 +4727,13 @@ namespace ts {
47264727
(<ClassDeclaration>container.parent).members);
47274728
break;
47284729
case SyntaxKind.ClassDeclaration:
4729-
nodes = (<ClassDeclaration>container).members;
4730+
case SyntaxKind.ClassExpression:
4731+
nodes = (<ClassLikeDeclaration>container).members;
47304732

47314733
// If we're an accessibility modifier, we're in an instance member and should search
47324734
// the constructor's parameter list for instance members as well.
47334735
if (modifierFlag & NodeFlags.AccessibilityModifier) {
4734-
let constructor = forEach((<ClassDeclaration>container).members, member => {
4736+
let constructor = forEach((<ClassLikeDeclaration>container).members, member => {
47354737
return member.kind === SyntaxKind.Constructor && <ConstructorDeclaration>member;
47364738
});
47374739

0 commit comments

Comments
 (0)