Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Milestone: Decorator Support #63

Closed
@JamesHenry

Description

@JamesHenry

This issue it to track progress against supporting decorators within the final AST that the parser produces. We currently remove them during parsing.

We need to ensure that the following are accurately carried over from the original TypeScript AST:

  • Parameter Decorators
    • On instance member
    • On static member
    • In constructor
  • Method Decorators
    • On instance member
    • On static member
  • Accessor Decorators
    • On instance member
    • On static member
  • Property Decorators
    • On instance member
    • On static member
  • Class Decorators

We also need to account for the difference between decorators and decorator factories:

Decorator:
unspecified-11

Decorator Factory:
unspecified-12

At the AST-level, the decorator node has an Identifier TSNode as an expression, whereas the decorator factory has a CallExpression TSNode.

Decorators are not currently covered by the ESTree spec as they are still a fairly early-stage es-proposal, but Angular 2, for example, has adopted them as a core aspect of the framework.

TypeScript adds a decorators array to the node in question, and I propose we do the same.

Resources:
https://www.typescriptlang.org/docs/handbook/decorators.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions