aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
AgeCommit message (Collapse)Author
2017-05-12remove support for `const` (#1910)Alex Lam S.L
As this is not part of ES5.
2017-05-12fix invalid transform on `const` (#1919)Alex Lam S.L
- preserve (re)assignment to `const` for runtime error - suppress `cascade` on `const`, as runtime behaviour is ill-defined
2017-05-06enhance `collapse_vars` (#1862)Alex Lam S.L
- 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
2017-04-23fix `AST_For.init` patch-up in `drop_unused()` (#1839)Alex Lam S.L
fixes #1838
2017-04-20improve `unused` (#1832)Alex Lam S.L
- extract leading value with side-effects out of `var` statement - reduce scanning of `AST_Definitions` from 3 passes to just once
2017-04-20fix `unused` on labeled for-loop (#1831)Alex Lam S.L
fixes #1830
2017-04-17compress duplicated variable definitions (#1817)Alex Lam S.L
These are surprisingly common, as people reuse the same variable name within loops or switch branches.
2017-04-08fix `delete` corner cases (#1799)Alex Lam S.L
- assignment - boolean - conditional - sequence
2017-03-30optimize try-catch-finally (#1731)Alex Lam S.L
- eliminate empty blocks - flatten out if try-block does not throw
2017-03-29fix corner case in `unused` (#1718)Alex Lam S.L
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.
2017-03-28fix `unused` on var of the same name within catch (#1716)Alex Lam S.L
fixes #1715
2017-03-28drop anonymous function name when overshadowed by other declarations (#1712)Alex Lam S.L
fixes #1709
2017-03-25fix invalid `AST_For.init` (#1657)Alex Lam S.L
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
2017-03-09fix & improve function argument compression (#1584)Alex Lam S.L
- one-use function call => IIFE should take `eval()` & `arguments` into account - if unused parameter cannot be eliminated, replace it with `0` fixes #1583
2017-03-09scan RHS of dropped assignments (#1581)Alex Lam S.L
- similar case as #1578 but against #1450 instead - fix `this` binding in #1450 as well closes #1580
2017-03-08scan assignment value in drop_unused() (#1578)Alex Lam S.L
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
2017-03-03process code with implicit return statement (#1522)Alex Lam S.L
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
2017-03-03fix chained assignment with `unused` (#1540)Alex Lam S.L
When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused. fixes #1539
2017-02-24enable `collapse_vars` & `reduce_vars` by defaultalexlamsl
- fix corner cases in `const` optimisation - deprecate `/*@const*/` fixes #1497 closes #1498
2017-02-21fix `pure_funcs` & improve `side_effects`alexlamsl
- only drops side-effect-free arguments - drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement` closes #1494
2017-02-21improve keep_fargs & keep_fnamesalexlamsl
- utilise in_use_ids instead of unreferenced() - drop_unused now up-to-date for subsequent passes closes #1476
2017-02-21drop unused: toplevel, assign-onlyalexlamsl
- 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
2015-09-14Control keeping function arguments with a single optionVille Lautanala
2015-03-20Keep unused function arguments by defaultMihai Bazon
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
2015-01-04Add a "keep_fnames" option to the compressor to retain function expression namesRichard van Velzen
See #552. This is useful for stack traces.
2013-12-05AST_Catch shouldn't really inherit from AST_Scope. Fix #363Mihai Bazon
I hereby acknowledge that figure_out_scope has become a mess.
2013-08-07Don't drop unused setter argument.Mihai Bazon
Fix #257
2012-10-13drop unused function argumentsMihai Bazon
also add test for "drop_unused" (the last one fails for now)