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

The single statement containing the TS Enum is not being transformed #9531

Closed
magic-akari opened this issue Sep 4, 2024 · 1 comment · Fixed by #9532
Closed

The single statement containing the TS Enum is not being transformed #9531

magic-akari opened this issue Sep 4, 2024 · 1 comment · Fixed by #9532
Labels
Milestone

Comments

@magic-akari
Copy link
Member

magic-akari commented Sep 4, 2024

Describe the bug

All code ASR that allow only one statement will encounter this issue.

Input code

if (true) enum Foo { };

while (false) enum Bar {};

for (const x of [1]) enum X { }

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2022"
  },
  "isModule": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.7.23&code=H4sIAAAAAAAAA8tMU9AoKSpN1VRIzSvNVXDLz1eoVqi15uIqz8jMSVXQSEvMKYZJOiUWKVSD5NLyixQ0kvPziksUKhTy0xSiDWOhSiJAugGejZhSVAAAAA%3D%3D&config=H4sIAAAAAAAAA6vmUlBQyipOVrJSqAYygZyCxKLi1CI4HyhSXJlXklgBFFEqqSxILU4uyiwoUQJL1upA9JQkFqWnloBUpBYbGRgZgWTBckqZxb75KaU5qUC5kqLSVK5aAM10JExxAAAA

SWC Info output

No response

Expected behavior

enum and namespace should be transformed.

Actual behavior

No response

Version

1.7.23

Additional context

No response

@kdy1 kdy1 added this to the Planned milestone Sep 4, 2024
@magic-akari magic-akari changed the title The single statement containing the Enum/TypeScript namespace is not being transformed The single statement containing the TS Enum is not being transformed Sep 4, 2024
@kdy1 kdy1 closed this as completed in #9532 Sep 4, 2024
kdy1 pushed a commit that referenced this issue Sep 4, 2024
@kdy1 kdy1 modified the milestones: Planned, v1.7.24 Sep 8, 2024
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 9, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants