Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Conversation

arodionov
Copy link
Contributor

@arodionov arodionov commented Nov 13, 2024

Created new JS.FunctionDeclaration to represent ts.FunctionExpression and ts.FunctionDeclaration.
Refactored visitFunctionDeclaration from J.MethodDeclaration to JS.FunctionDeclaration

The reason to implement a new custom type (and don't use J.MethodDeclaration or JS.ArrowFunctioninstead):

  • the ts.FunctionExpression is an expression, but J.MethodDeclaration is a statement
  • the ts.FunctionDeclaration can have generics, but JS.ArrowFunction doesn't support them

Created new JS.FunctionDeclaration to represent ts.FunctionExpression and ts.FunctionDeclaration.
Refactored visitFunctionDeclaration from J.MethodDeclaration to JS.FunctionDeclaration
@arodionov arodionov requested review from OlegDokuka and knutwannheden and removed request for knutwannheden November 13, 2024 12:53
@arodionov arodionov self-assigned this Nov 13, 2024
describe('function decorator mapping', () => {
// according to TypeScript documentation decorators are not allowed with
// standalone functions https://www.typescriptlang.org/docs/handbook/decorators.html
describe.skip('function decorator mapping', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped decorators' tests can be removed.

According to TypeScript documentation, decorators are not allowed with standalone functions https://www.typescriptlang.org/docs/handbook/decorators.html

@arodionov arodionov merged commit e5249c2 into main Nov 15, 2024
2 checks passed
@arodionov arodionov deleted the function-declaration branch November 15, 2024 12:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants