qcert
qcert copied to clipboard
Javascript backend does not avoid keywords correctly
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"!
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).
Question about this: why do we prepend at all? Shouldn't the clean-up logic prevent the need to prepend?