Handle for-of and for-in the same way when translating destructuring.
@@ -67,9 +67,6 @@ public final class Es6RewriteDestructuring implements NodeTraversal.Callback, Ho
case PARAM_LIST:
visitParamList(n, parent);
break;
- case FOR_OF:
- visitForOf(n);
- break;
default:
break;
}
@@ -215,13 +212,6 @@ public final class Es6RewriteDestructuring implements NodeTraversal.Callback, Ho
return tempVarName;
}
- private void visitForOf(Node node) {
- Node lhs = node.getFirstChild();
- if (lhs.isDestructuringLhs()) {
- visitDestructuringPatternInEnhancedFor(lhs.getFirstChild());
- }
- }
-
private void visitPattern(NodeTraversal t, Node pattern, Node parent) {
if (NodeUtil.isNameDeclaration(parent) && !NodeUtil.isEnhancedFor(parent.getParent())) {
replacePattern(t, pattern, pattern.getNext(), parent, parent);
