Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(processing/script/transformers/location): handle class property definitions #3033

Merged

Conversation

sorin-davidoi
Copy link
Contributor

@sorin-davidoi sorin-davidoi commented Dec 9, 2024

Purpose

The transformers generates wrong (and invalid) JavaScript if a class contains a property named locations.

The generated code for class C { location } currently is class C { __get$Loc(location) }.

Approach

Extend the transformer to handle class property definitions in the same way other processing exceptions are handled.

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

…efinitions

The transformers generates wrong (and invalid) JavaScript if a class contains a
property named `locations`.

The generated code currently is `class C{ __get$Loc(location) }`.
@@ -68,6 +68,11 @@ const transformer: Transformer<Identifier> = {
if (parent.type === Syntax.MethodDefinition)
return false;

// Skip: class X { location }
// @ts-ignore
if (parent.type === Syntax.PropertyDefinition)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to add this to esotope-hammerhead if there is consensus on merging this.

@sorin-davidoi sorin-davidoi marked this pull request as ready for review December 9, 2024 14:52
@PavelMor25
Copy link
Contributor

Hello @sorin-davidoi,

We sincerely appreciate your contribution and the effort you put into it! Thank you for your contribution!

Regarding adding this to esotope-hammerhead, we suggest not making changes there and keeping them limited to this project instead.

@PavelMor25 PavelMor25 merged commit 04e27ba into DevExpress:master Dec 13, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants