aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
AgeCommit message (Expand)Author
2016-04-02Optimize ternaries with boolean consequent or alternative....Fixes #511 kzc
2016-03-28Speedup `unused` compress option for already minified code...Fixes: #321 #917 #1022 kzc
2016-02-22boolean_expression ? true : false --> boolean_expressionkzc
2016-02-21Take operator || precendence into account for AST_If optimization....Fixes #979. kzc
2016-02-17preserve ThisBinding for side_effectsalexlamsl
2016-02-16Don't compress (0, eval)() to eval()Richard van Velzen
2016-02-16Preserve ThisBinding in conditionals & collapse_vars...Fixes #973 alexlamsl
2016-01-29collapse_vars: avoid replacement across AST_Case nodes to be on safe side eve...kzc
2016-01-28collapse_vars: fix if/else and ternary operator side effectskzc
2016-01-28collapse_vars: fix bug in repeated var defs of same namekzc
2016-01-27fix bug in collapse_vars for right side of "||" and "&&"kzc
2016-01-27Collapse single use var definitions...Fix #721 kzc
2016-01-05Fix hoisting the var in ForIn...Close #913 Mihai Bazon
2015-11-24#873 Fix `conditionals` optimizations with default compress optionskzc
2015-11-16Fix endless loop...Close #866 Mihai Bazon
2015-11-16Limit max iterations for tighten_body...Ref #866 Mihai Bazon
2015-11-11Rework has_directive...It's now available during tree walking, i.e. walker.has_directive("use asm"), rather than as part of the scope. It's thus no longer necessary to call `figure_out_scope` before codegen. Added special bits in the code generator to overcome the fact that it doesn't inherit from TreeWalker. Fix #861 Mihai Bazon
2015-10-29`return undefined` optimization no longer uses `return_void_0` optionkzc
2015-10-29optimize `return undefined` and `return void 0`kzc
2015-10-07Add proper support for "use asm"; blocks. Disable -c optimization within "use...kzc
2015-09-14Control keeping function arguments with a single optionVille Lautanala
2015-08-25Don't change sequences that influence lexical binding in calls...Fixes #782 Richard van Velzen
2015-08-10[Fix] --define replaces SymbolRefs in LHS of assignments...See #208 for context Christopher Chedeau
2015-07-29Advanced way to specify if a function call might have side effects. #400thorn0
2015-07-22Don't attempt to negate non-boolean AST_Binary...Fix #751 Mihai Bazon
2015-07-20Merge pull request #735 from kzc/master...optimizations for && and || where left side is constant expressionMihai Bazon
2015-06-30Don't drop parens in a * (b * c). Close #744Mihai Bazon
2015-06-14operator && and || optimization: add "else" before "if" as intendedkzc
2015-06-11optimizations for && and || where left side is constant expressionkzc
2015-05-18Fix compressing conditionals...Only transform foo() ? EXP(x) : EXP(y) into EXP(foo() ? x : y) if EXP has no side effects. Fix #710 Mihai Bazon
2015-05-04Avoid spurious brackets when dropping unused vars...Fix #702 Mihai Bazon
2015-04-17Drop NaN -> 0/0 transformation....Fix #687 Mihai Bazon
2015-04-13Fix compression of conditionals...Don't move the condition on the right side of an assignment when the left side may have side effects. Fix #677 Mihai Bazon
2015-03-23Fix compressing `![foo()];` as a statement...need to check whether the literal has any side effects before replacing that with `false`. Mihai Bazon
2015-03-22[sequencesize] Actually even better:...do create the sequence even if the stat list is bigger than 2000 statements, but limit the sequence itself to 2000 expressions. Ref #414 Mihai Bazon
2015-03-22Avoid sequencesize for more than 2000 statements....It hardly saves any bytes for a sequence so long, and it risks blowing the stack with the recursive Seq functions. Ref #414 Mihai Bazon
2015-03-22Add start/end nodes for NaN/Infinity transformationsMihai Bazon
2015-03-20Keep unused function arguments by default...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 Mihai Bazon
2015-02-11Fix invalid removal of left side in && and || compression...See #637. This does not produce the optimal result, but it does prevent the removal of non-side-effect-free code. Richard van Velzen
2015-01-31Drop all `console` statements properly...Because the base reference can be an member expression as well, we have to dig a bit deeper to find the leftmost base reference. Fixes #451 Richard van Velzen
2015-01-13Optimize conditionals where the consequent and alternative are both booleans ...Tal Ater
2015-01-12Replace the correct node when replacing in `void` sequences...Close #611. Richard van Velzen
2015-01-11Merge pull request #482 from arty-name/inline-ng-inject...added @ngInject support for inline functionsMihai Bazon
2015-01-07Fix make_node_from_constant for Regexp-s...Close #588 Mihai Bazon
2015-01-06aborts(AST_If) returns the `if` node...Previously it returned the abort node from the alternative branch. This is not much use as it can be different from the one in the body branch (i.e. return vs. throw) and can trick us into issues like #591. Fix #591 Mihai Bazon
2015-01-05Support keep_fnames in compressor, and --keep-fnames. #552...Passing `--keep-fnames` will enable it both for compressor/mangler, so that function names will not be dropped (when unused) nor mangled. Mihai Bazon
2015-01-04Fix #569...When no arguments are given to `new Function()`, it should be treated as a regular anonymous function (http://es5.github.io/#x15.3.2.1) Richard van Velzen
2014-12-31Fix #597...NaN and Infinity were replaced in the output generation, instead of during compression. This could lead to results where `1/0` was inserted without parens leading to invalid output. The nodes are replaced in the compression step now, and the output generation returns their regular names. This should not be a problem, since they're already only constructed from the original name. Richard van Velzen
2014-09-28Referencing a global is assumed to have side effects....Close #550 Mihai Bazon
2014-09-04Compress conditions that have side effects using sequencesTal Ater