Skip to content

Commit

Permalink
visitor(delete-unused-var): Do not delete a var if its init is not a …
Browse files Browse the repository at this point in the history
…literal. #120

Signed-off-by: echo094 <[email protected]>
  • Loading branch information
echo094 committed Sep 18, 2024
1 parent bf5cf12 commit 008b96a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/visitor/delete-unused-var.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
if (!binding || binding.referenced || !binding.constant) {
return
}
if (t.isCallExpression(node.init)) {
if (!t.isLiteral(node.init)) {
return
}
const up1 = path.parentPath
Expand Down

0 comments on commit 008b96a

Please sign in to comment.