Skip to content

Strange spans for exported classes with decorators #10409

@overlookmotel

Description

@overlookmotel
@dec export class A {}

This produces strange spans:

  • ExportNamedDeclaration: start 5, end 22
  • Class: start 0, end 22
  • Decorator: start 0, end 4

Class is a child of ExportNamedDeclaration but the child has a span which starts before the parent. This seems odd.

I assume we should consider this to be incorrect?

Playground

(ignore that Program start span isn't 0 in Playground. That's an artefact of ESTree conversion - it's 0 in Rust AST, as it should be).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions