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 issue #60

Closed
edysmp opened this issue Aug 1, 2023 · 2 comments
Closed

Parsing issue #60

edysmp opened this issue Aug 1, 2023 · 2 comments

Comments

@edysmp
Copy link

edysmp commented Aug 1, 2023

The following JS code:

if (true) {
const CMS = 'Drupal';
}

parses to:
if (true) const CMS = 'Drupal';

Which result in: SyntaxError: Unexpected token 'const'

@mck89 mck89 closed this as completed in 3f57998 Aug 3, 2023
@mck89
Copy link
Owner

mck89 commented Aug 3, 2023

The solution was to add the brackets in that case, the problem was also present of for and while statements, now it's fixed. Thank you.

@edysmp
Copy link
Author

edysmp commented Aug 4, 2023

This was quick! Thanks!

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

2 participants