Created
February 29, 2012 01:27
-
-
Save cramforce/1936805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final boolean[] ok = new boolean[]{true}; | |
final int[] returnCount = new int[]{0}; | |
NodeTraversal.traverse(compiler, block, new AbstractShallowCallback() { | |
@Override | |
public void visit(NodeTraversal t, Node n, Node parent) { | |
if (n.isName() && "arguments".equals(n.getString())) { | |
ok[0] = false; | |
} | |
if(n.isReturn()) { | |
returnCount[0]++; | |
} | |
// Look for eval or just let people shoot themselves in the foot? | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment