-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unshadowing (with avoid list) confusion in JavaScript code-generation #80
Comments
This problem is not restricted to things like this -- it appears that every time we suffix with a number we do so only on the declaration, not on the use!
This happens to Marketers as well! |
Actually, looking into this more resulted in noticing #82 as well |
to be clear, we are talking about free variables here. I think the fix here is to
|
4ae6a5f addresses the duplication problem. |
97e51e4 fixes this particular example (almost as a side-effect), since the variable is first rewritten to "c$" as part of the let (which is a bit hacky, incidentally). However, the output is a bit nicer in that it distinguishes the variables that refer to constants from other ones. However, it does not really fix the problem, so I am leaving this issue open. A proper fix probably involves one of these options:
I lean towards the first option, as it leaves unshadow alone, and acknowledges that the NNRCLet bindings being added are really a convenience to reuse some of the translator, rather then being actually semantically equivalent NNRC. |
also, see #82 |
I agree with the analysis (nice btw!), and I think I like the first option as well. |
There seem to be a bit of confusion in the way the avoid list collides with the variable or constant names. During code generation, variables get prefixed with
v
. If you have a global constant with name e.g.,this
, you end up with inconsistent JavaScript code.The text was updated successfully, but these errors were encountered: