aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
AgeCommit message (Collapse)Author
2016-06-30Fix spidermonkey AST (ESTree) export and import, Array holeskzc
Fixes: #1156 #1161 Also add test to exercise Uglify after spidermonkey export/import of itself.
2016-06-21Fix conditional expressions of form (x ? -1 : -1)kzc
Fixes #1154, #1153
2016-06-21Don't replace undefined, NaN and Infinity within with scopekzc
2016-06-15Fix test262 failures related to <, <=, in and instanceofAnthony Van de Gejuchte
Fixed-by: @kzc
2016-06-12Don't drop unused if scope uses with statementAnthony Van de Gejuchte
Fix provided by @kzc
2016-05-27collapse_vars: Do not consider RegExp literals to be constantskzc
Fixes #1100
2016-05-24Optimize if_return for single if/return cases.kzc
Fixes #1089
2016-05-24Completely allow evaluating -0Richard van Velzen
2016-05-17Never produce -0 when evaluating expressions (like -"")Richard van Velzen
Fix for #1085. The major case was already there, but more expressions can result in -0.
2016-05-15Simplify iife `new` fixkzc
as suggested by @rvanvelzen. Added a test for IIFEs in nested contexts.
2016-05-09Do not apply negate_iife optimization to `new` expressionkzc
2016-04-23Hoist functions when reversing if (x) return; ... vs. if (!x) ...Richard van Velzen
Fixes #1052
2016-04-19Add `passes` compress option. Fix duplicate compress warnings.kzc
2016-04-13Prevent endless recursion when evaluating self-referencing constsRichard van Velzen
Fix #1041
2016-04-12Actually limit sequence length.Mihai Bazon
Fix #1038
2016-04-11Fix warnings for referenced non-hoisted functions.kzc
Fixes #1034 Also added `expect_warnings` functionality to test framework.
2016-04-07Avoid using inherited hasOwnPropertyMihai Bazon
Fix #1031
2016-04-02Optimize ternaries with boolean consequent or alternative.kzc
Fixes #511
2016-03-28Speedup `unused` compress option for already minified codekzc
Fixes: #321 #917 #1022
2016-02-22boolean_expression ? true : false --> boolean_expressionkzc
2016-02-21Take operator || precendence into account for AST_If optimization.kzc
Fixes #979.
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_varsalexlamsl
Fixes #973
2016-01-29collapse_vars: avoid replacement across AST_Case nodes to be on safe side ↵kzc
even though no issues seen.
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 definitionskzc
Fix #721
2016-01-05Fix hoisting the var in ForInMihai Bazon
Close #913
2015-11-24#873 Fix `conditionals` optimizations with default compress optionskzc
2015-11-16Fix endless loopMihai Bazon
Close #866
2015-11-16Limit max iterations for tighten_bodyMihai Bazon
Ref #866
2015-11-11Rework has_directiveMihai Bazon
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
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 ↵kzc
"use asm"; sections and preserve floating point literals in their original form. Non-asm.js sections are optimized as before. Asm.js sections can still be mangled and minified of whitespace. No special command line flags are required.
2015-09-14Control keeping function arguments with a single optionVille Lautanala
2015-08-25Don't change sequences that influence lexical binding in callsRichard van Velzen
Fixes #782
2015-08-10[Fix] --define replaces SymbolRefs in LHS of assignmentsChristopher Chedeau
See #208 for context
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_BinaryMihai Bazon
Fix #751
2015-07-20Merge pull request #735 from kzc/masterMihai Bazon
optimizations for && and || where left side is constant expression
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 conditionalsMihai Bazon
Only transform foo() ? EXP(x) : EXP(y) into EXP(foo() ? x : y) if EXP has no side effects. Fix #710
2015-05-04Avoid spurious brackets when dropping unused varsMihai Bazon
Fix #702
2015-04-17Drop NaN -> 0/0 transformation.Mihai Bazon
Fix #687
2015-04-13Fix compression of conditionalsMihai Bazon
Don't move the condition on the right side of an assignment when the left side may have side effects. Fix #677