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

Parsing fails when a class property is named global #1682

Open
TheFireBlast opened this issue Feb 16, 2024 · 0 comments · May be fixed by #1688
Open

Parsing fails when a class property is named global #1682

TheFireBlast opened this issue Feb 16, 2024 · 0 comments · May be fixed by #1688

Comments

@TheFireBlast
Copy link

Expected Behavior

Compile normally.

Actual Behavior

Compilation fails from a parsing error:

[!] (plugin commonjs--resolver) RollupError: Unexpected token `.`. Expected * for generator, private key, identifier or async
index.js (2:10)
1: class Foo {
2:     global;
             ^
3: }
4: exports = Foo
    at error (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/parseAst.js:279:30)
    at parseError (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/parseAst.js:1041:9)
    at convertNode (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/parseAst.js:2130:12)
    at convertProgram (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/parseAst.js:1034:12)
    at Object.parseAstAsync (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/parseAst.js:2181:12)
    at Module.tryParseAsync (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/rollup.js:15008:20)
    at Module.setSource (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/rollup.js:14589:35)
    at ModuleLoader.addModuleSource (/home/fire/source/js/test-rollup/node_modules/.pnpm/rollup@4.11.0/node_modules/rollup/dist/shared/rollup.js:18937:13)

Additional Information

Code compiles without the plugin enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant