public class IdentifierGlobalScopeNameClashCheck extends Object implements CheckContributor<com.sun.source.tree.IdentifierTree>
void m() {
if (true) {
int x = 0;
}
int y = GlobalVars.x;
}
After generation you'll have:
function m() {
if (true) {
var x = 0;
}
var y = x;
}
The global x will be in fact hidden by the local variable.| Constructor and Description |
|---|
IdentifierGlobalScopeNameClashCheck() |
| Modifier and Type | Method and Description |
|---|---|
static Void |
checkGlobalScope(com.sun.source.tree.ExpressionTree tree,
String name,
GenerationContext<Void> context) |
Void |
visit(CheckVisitor visitor,
com.sun.source.tree.IdentifierTree tree,
GenerationContext<Void> context) |
public static Void checkGlobalScope(com.sun.source.tree.ExpressionTree tree, String name, GenerationContext<Void> context)
public Void visit(CheckVisitor visitor, com.sun.source.tree.IdentifierTree tree, GenerationContext<Void> context)
visit in interface VisitorContributor<com.sun.source.tree.IdentifierTree,Void,GenerationContext<Void>,CheckVisitor>Copyright © 2015. All Rights Reserved.