babel / babel/minify

More optimizations

Open
#25 26 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

- [x] Remove unused args (e.g. `bar` in `function foo(bar) { }`)
- [x] Remove space after `return` when possible (e.g. `return [1,2,3]` → `return[1,2,3]`)
- [ ] `var result = expression(); foo.bar = result;` → `foo.bar = expression()`
- [ ] Better constant propagation (looks like it is in the dead-code-elimination plugin, but its a combination of both)

``` js
var b = () => {
var x = 14;
var y = 7 - x / 2;
return y * (28 / x + 2);
};
```

``` js
var a = () => {
var a = 14;

return (7 - a / 2) * (28 / a + 2);
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.