Remove duplicate code from ControlFlowAnalysis
Just use NodeUtil.isLoopStructure() instead.
@@ -917,7 +917,7 @@ final class ControlFlowAnalysis implements Callback, CompilerPass {
*/
static boolean isContinueTarget(
Node target, String label) {
- return isContinueStructure(target) && matchLabel(target.getParent(), label);
+ return NodeUtil.isLoopStructure(target) && matchLabel(target.getParent(), label);
}
/**
@@ -989,22 +989,6 @@ final class ControlFlowAnalysis implements Callback, CompilerPass {
}
}
- /**
- * Determines whether the given node can be advanced with a CONTINUE node.
- */
- static boolean isContinueStructure(Node n) {
- switch (n.getToken()) {
- case FOR:
- case FOR_IN:
- case FOR_OF:
- case DO:
- case WHILE:
- return true;
- default:
- return false;
- }
- }
-
/**
* Get the TRY block with a CATCH that would be run if n throws an exception.
* @return The CATCH node or null if it there isn't a CATCH before the
