Skip to content

Instantly share code, notes, and snippets.

@cramforce
Created February 29, 2012 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cramforce/1936805 to your computer and use it in GitHub Desktop.
Save cramforce/1936805 to your computer and use it in GitHub Desktop.
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