babel / babel/minify

Improve replace + DCE w. surrounding blocks

Open
#287 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

When Babili is run with replacements, such as to replace `console.log` with empty function, but there's surrounding block, that block is never removed:

```
if (!this.smth) {
console.log("foo bar");
}
```

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Reproduce the Babili replacement example with the surrounding if block, then trace the replacement and dead-code-elimination passes; done means the block is removed when its only statement becomes an empty function call.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.