fix: remove empty const/let/var declarations caused by removal of MARKO_DEBUG expressions

This commit is contained in:
Michael Rawlings 2021-09-23 15:00:45 -07:00 committed by Dylan Piercey
parent c01205480a
commit 086533ead4

View File

@ -67,6 +67,10 @@ function replaceMarkoDebug(path, test, consequent, alternate) {
path.replaceWith(alternate);
}
} else {
path.remove();
if (path.parentPath.node.type === "VariableDeclarator") {
path.parentPath.remove();
} else {
path.remove();
}
}
}