Age | Commit message (Expand) | Author |
2017-02-21 | improve keep_fargs & keep_fnames...- utilise in_use_ids instead of unreferenced()
- drop_unused now up-to-date for subsequent passes
closes #1476
| alexlamsl |
2017-02-21 | smarter const replacement taking name length into account...closes #1459
| kzc |
2017-02-21 | clean up `negate_iife`...- remove extra tree scanning phase for `negate_iife`
- `negate_iife` now only deals with the narrowest form, i.e. IIFE sitting directly under `AST_SimpleStatement`
- `booleans`, `conditionals` etc. will now take care the rest via more accurate accounting
- `a(); void b();` => `a(); b();`
fixes #1288
closes #1451
| alexlamsl |
2017-02-21 | improve string concatenation...shuffle associative operations to minimise parentheses and aid other uglification efforts
closes #1454
| alexlamsl |
2017-02-21 | `-c sequences=N` suboptimal at N expression cutoff...N = 2:
a;
b;
c;
d;
was:
a, b;
c;
d;
now:
a, b;
c, d;
fixes #1455
closes #1457
| alexlamsl |
2017-02-21 | tweak do-while loops...- `do{...}while(false)` => `{...}`
- clean up `AST_While` logic
closes #1452
| alexlamsl |
2017-02-21 | fixes & improvements to [].join()...fixes
- [a].join() => "" + a
- ["a", , "b"].join() => "a,,b"
- ["a", null, "b"].join() => "a,,b"
- ["a", undefined, "b"].join() => "a,,b"
improvements
- ["a", "b"].join(null) => "anullb"
- ["a", "b"].join(undefined) => "a,b"
- [a + "b", c].join("") => a + "b" + c
closes #1453
| alexlamsl |
2017-02-21 | drop unused: toplevel, assign-only...- 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
| alexlamsl |
2017-02-21 | fix stray else in compress with conditionals=false...closes #1449
| kzc |
2017-02-18 | enable typeof "undefined" for general use...move out of unsafe, guard corner case with screw_id8 instead
closes #1446
| alexlamsl |
2017-02-18 | fix crash in unsafe replacement of undefined...remove extraneous call to AST_SymbolRef.reference()
closes #1443
| alexlamsl |
2017-02-18 | Improve optimizing `function() { if(c){return foo} bar();}`...closes #1437
| Anthony Van de Gejuchte |
2017-01-26 | optimise binary operands with evaluate() (#1427)...- remove call to evaluate() in is_constant() and let nested optimize() does its job instead
- reject RegExp in is_constant() and remove special case logic under collapse_vars
- operands to conditionals optimisation are now always evaluate()-ed
- throw error in constant_value() instead of returning undefined to catch possible bugs, similar to make_node_from_constant()
- optimise binary boolean operators under `evaluate` instead of `conditionals` | Alex Lam S.L |
2017-01-26 | augment evaluate to extract within objects (#1425)...- gated by `unsafe`
- replaces previous optimisation specific to String.length
- "123"[0] => 1
- [1, 2, 3][0] => 1
- [1, 2, 3].length => 3
- does not apply to objects with overridden prototype functions | Alex Lam S.L |
2017-01-19 | add missing LHS cases which global_defs should avoid | alexlamsl |
2016-11-29 | Do not overwrite options.comments + cleanup | Anthony Van de Gejuchte |
2016-10-06 | Fix (typeof side_effect()) in boolean context...Fixes #1289 with suggestion by @rvanvelzen
| kzc |
2016-10-01 | Optimize unmodified variables | alexlamsl |
2016-09-01 | Account for side effects in `string + expr` optimization | kzc |
2016-08-30 | implement optimization: (x = 2 * x) ---> (x *= 2) | kzc |
2016-08-17 | Fix negate_iife transform to return a correct tree for nested IIFEs...Fix for #1256, partially reverts d854523783b4
| Richard van Velzen |
2016-07-15 | Keep const in own scope while compressing...- Fixes #1205
- Fix provided by @kzc
| Anthony Van de Gejuchte |
2016-07-01 | Change the default sequences limit to 200 to speed up compress....Has little or no impact on minification size in the majority of
cases but can speed up rollup builds significantly.
This sequences change also has the beneficial side effect of avoiding
"stack size exceeded" errors on very large input files.
The user is free to alter the sequences limit if they are so inclined.
The previous sequences limit was 2000. 20 is often sufficient.
| kzc |
2016-07-01 | Allow sequences maximum length to be user configurable. | kzc |
2016-06-30 | Enable --screw-ie8 by default....catch identifier is mangled correctly for ES5 standards-compliant JS engines by default.
Unconditionally use the ie8 if/do-while workaround whether or not --screw-ie8 is enabled.
To support non-standard ie8 javascript use: uglifyjs --support-ie8
| kzc |
2016-06-30 | Fix spidermonkey AST (ESTree) export and import, Array holes...Fixes: #1156 #1161
Also add test to exercise Uglify after spidermonkey export/import of itself.
| kzc |
2016-06-21 | Fix conditional expressions of form (x ? -1 : -1)...Fixes #1154, #1153
| kzc |
2016-06-21 | Don't replace undefined, NaN and Infinity within with scope | kzc |
2016-06-15 | Fix test262 failures related to <, <=, in and instanceof...Fixed-by: @kzc
| Anthony Van de Gejuchte |
2016-06-12 | Don't drop unused if scope uses with statement...Fix provided by @kzc
| Anthony Van de Gejuchte |
2016-05-27 | collapse_vars: Do not consider RegExp literals to be constants...Fixes #1100
| kzc |
2016-05-24 | Optimize if_return for single if/return cases....Fixes #1089
| kzc |
2016-05-24 | Completely allow evaluating -0 | Richard van Velzen |
2016-05-17 | Never produce -0 when evaluating expressions (like -"")...Fix for #1085. The major case was already there, but more expressions can result in -0.
| Richard van Velzen |
2016-05-15 | Simplify iife `new` fix...as suggested by @rvanvelzen.
Added a test for IIFEs in nested contexts.
| kzc |
2016-05-09 | Do not apply negate_iife optimization to `new` expression | kzc |
2016-04-23 | Hoist functions when reversing if (x) return; ... vs. if (!x) ......Fixes #1052
| Richard van Velzen |
2016-04-19 | Add `passes` compress option. Fix duplicate compress warnings. | kzc |
2016-04-13 | Prevent endless recursion when evaluating self-referencing consts...Fix #1041
| Richard van Velzen |
2016-04-12 | Actually limit sequence length....Fix #1038
| Mihai Bazon |
2016-04-11 | Fix warnings for referenced non-hoisted functions....Fixes #1034
Also added `expect_warnings` functionality to test framework.
| kzc |
2016-04-07 | Avoid using inherited hasOwnProperty...Fix #1031
| Mihai Bazon |
2016-04-02 | Optimize ternaries with boolean consequent or alternative....Fixes #511
| kzc |
2016-03-28 | Speedup `unused` compress option for already minified code...Fixes: #321 #917 #1022
| kzc |
2016-02-22 | boolean_expression ? true : false --> boolean_expression | kzc |
2016-02-21 | Take operator || precendence into account for AST_If optimization....Fixes #979.
| kzc |
2016-02-17 | preserve ThisBinding for side_effects | alexlamsl |
2016-02-16 | Don't compress (0, eval)() to eval() | Richard van Velzen |
2016-02-16 | Preserve ThisBinding in conditionals & collapse_vars...Fixes #973
| alexlamsl |
2016-01-29 | collapse_vars: avoid replacement across AST_Case nodes to be on safe side eve... | kzc |