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

Javascript backend does not avoid keywords correctly #82

Open
shinnar opened this issue Jan 10, 2018 · 2 comments
Open

Javascript backend does not avoid keywords correctly #82

shinnar opened this issue Jan 10, 2018 · 2 comments
Assignees

Comments

@shinnar
Copy link
Contributor

shinnar commented Jan 10, 2018

It prefixes all variables emmitted with "v", but the avoidance code does not account for this.
As a result, "this", for example, is suffixed to avoid a conflict (needlessly, since it is already prefixed with v), but "ar" is not, which is an actual problem -- since we then output a variable called "var"!

@shinnar
Copy link
Contributor Author

shinnar commented Jan 11, 2018

we currently are prepending "v" (and now "vc$") to our emitted variables, but we check for javascript keyword conflicts with the un-prepended version. So it complains about "this", but not about "ar" (well not for the free variable/constant "this", since it looks like "c$this" to the unshadower, but that is a hack on top of a hack rather then a fix).

@jeromesimeon
Copy link
Member

Question about this: why do we prepend at all? Shouldn't the clean-up logic prevent the need to prepend?

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

No branches or pull requests

2 participants