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

Enum containing a value of its name produces invalid code #603

Open
featherbear opened this issue Mar 24, 2021 · 0 comments
Open

Enum containing a value of its name produces invalid code #603

featherbear opened this issue Mar 24, 2021 · 0 comments

Comments

@featherbear
Copy link

Input

enum MAIN {
    MAIN = 1,
}

  • Run sucrase with --transforms typescript,imports

Output

var MAIN; (function (MAIN) {

    const MAIN = 1; MAIN[MAIN["MAIN"] = MAIN] = "MAIN";

})(MAIN || (MAIN = {}));

This causes the interpreter to complain about MAIN already being declared

featherbear added a commit to featherbear/presonus-studiolive-api that referenced this issue Mar 24, 2021
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

No branches or pull requests

1 participant