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

Non keyword switch generates javascript SyntaxError #24

Closed
shaolo1 opened this issue Apr 11, 2016 · 3 comments
Closed

Non keyword switch generates javascript SyntaxError #24

shaolo1 opened this issue Apr 11, 2016 · 3 comments
Assignees
Labels

Comments

@shaolo1
Copy link

shaolo1 commented Apr 11, 2016

In javascript switch is a keyword, so the following
Python
switch = False
if switch:
print("switching")
Generates the invalid
Javascript
var switch = false;
if (switch) {
print ('switching');
}

@shaolo1
Copy link
Author

shaolo1 commented Apr 11, 2016

I've worked around this by renaming my variable to _switch, but ideally translation would deal with this by refusing to translate or automatically renaming.

@JdeH
Copy link
Collaborator

JdeH commented Apr 12, 2016

Will fix, thanks!

@JdeH JdeH added the IS: bug label Apr 12, 2016
@JdeH JdeH self-assigned this Apr 12, 2016
@JdeH
Copy link
Collaborator

JdeH commented Apr 21, 2016

Fixed experimentally. Testcase added.

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

No branches or pull requests

2 participants