MCPcopy Create free account
hub / github.com/microsoft/typescript-go / checkClassDeclaration

Method checkClassDeclaration

internal/checker/checker.go:4261–4274  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

4259}
4260
4261func (c *Checker) checkClassDeclaration(node *ast.Node) {
4262 firstDecorator := core.Find(node.ModifierNodes(), ast.IsDecorator)
4263 if c.legacyDecorators && firstDecorator != nil && core.Some(node.Members(), func(p *ast.Node) bool {
4264 return ast.HasStaticModifier(p) && ast.IsPrivateIdentifierClassElementDeclaration(p)
4265 }) {
4266 c.grammarErrorOnNode(firstDecorator, diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator)
4267 }
4268 if node.Name() == nil && !ast.HasSyntacticModifier(node, ast.ModifierFlagsDefault) {
4269 c.grammarErrorOnFirstToken(node, diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name)
4270 }
4271 c.checkClassLikeDeclaration(node)
4272 c.checkSourceElements(node.Members())
4273 c.registerForUnusedIdentifiersCheck(node)
4274}
4275
4276func (c *Checker) checkClassLikeDeclaration(node *ast.Node) {
4277 c.checkGrammarClassLikeDeclaration(node)

Callers 1

Calls 13

grammarErrorOnNodeMethod · 0.95
checkSourceElementsMethod · 0.95
FindFunction · 0.92
SomeFunction · 0.92
HasStaticModifierFunction · 0.92
HasSyntacticModifierFunction · 0.92
ModifierNodesMethod · 0.80
MembersMethod · 0.80

Tested by

no test coverage detected