Node parent = var.getParent();
// Special case when we are in FOR-IN loop.
if (NodeUtil.isForIn(parent)) {
var.removeChild(name);
parent.replaceChild(var, name);
} else if (var.hasOneChild()) {
// The removal is easy when there is only one variable in the VAR node.
if (name.hasChildren()) {
Node value = name.removeFirstChild();
var.removeChild(name);