Age | Commit message (Collapse) | Author |
|
As this is not part of ES5.
|
|
- preserve (re)assignment to `const` for runtime error
- suppress `cascade` on `const`, as runtime behaviour is ill-defined
|
|
- extend expression types
- `a++`
- `a=x;`
- extend scan range
- `for(init;;);`
- `switch(expr){case expr:}`
- `a = x; a = a || y;`
- terminate upon `debugger;`
closes #1821
fixes #27
fixes #315
fixes #1858
|
|
fixes #1838
|
|
- extract leading value with side-effects out of `var` statement
- reduce scanning of `AST_Definitions` from 3 passes to just once
|
|
fixes #1830
|
|
These are surprisingly common, as people reuse the same variable name within loops or switch branches.
|
|
- assignment
- boolean
- conditional
- sequence
|
|
- eliminate empty blocks
- flatten out if try-block does not throw
|
|
When fixing catch-related issue in #1715, it tries to optimise for duplicate definitions but did not take anonymous functions into account.
Remove such optimisation for now and we can cover this as a more general rule later.
|
|
fixes #1715
|
|
fixes #1709
|
|
Turns out the only place in `Compressor` which can generate invalid `AST_For.init` is within `drop_unused()`, so focus the fix-up efforts.
supercedes #1652
fixes #1656
|
|
- one-use function call => IIFE should take `eval()` & `arguments` into account
- if unused parameter cannot be eliminated, replace it with `0`
fixes #1583
|
|
- similar case as #1578 but against #1450 instead
- fix `this` binding in #1450 as well
closes #1580
|
|
those were not optimised for `unused` before, which made it necessary for `reduce_vars` to have separate steps for `keep_fnames`
docs update by @kzc
closes #1577
|
|
Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.
fixes #354
fixes #543
fixes #625
fixes #628
fixes #640
closes #1293
|
|
When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused.
fixes #1539
|
|
- fix corner cases in `const` optimisation
- deprecate `/*@const*/`
fixes #1497
closes #1498
|
|
- only drops side-effect-free arguments
- drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement`
closes #1494
|
|
- utilise in_use_ids instead of unreferenced()
- drop_unused now up-to-date for subsequent passes
closes #1476
|
|
- assign statement does not count towards variable usage by default
- only works with assignments on the same scope level as declaration
- can be disabled with `unused` set to "keep_assign"
- `toplevel` to drop unused top-level variables and/or functions
- `top_retain` to whitelist top-level exceptions
closes #1450
|
|
|
|
Discarding unused function arguments affects function.length, which can lead
to some hard to debug issues. This optimization is now done only in "unsafe
mode".
Fix #121
|
|
See #552. This is useful for stack traces.
|
|
I hereby acknowledge that figure_out_scope has become a mess.
|
|
Fix #257
|
|
also add test for "drop_unused" (the last one fails for now)
|