aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-03-17v2.8.13Alex Lam S.L
2017-03-17fix chained evaluation (#1610)...`reduce_vars` enables substitution of variables but did not clone the value's `AST_Node`. This confuses `collapse_vars` and result in invalid AST and subsequent crash. fixes #1609Alex Lam S.L
2017-03-16extend `test/run-tests.js` to optionally execute uglified output (#1604)...fixes #1588Alex Lam S.L
2017-03-16make `collapse_vars` consistent with `toplevel` (#1608)...fixes #1605Alex Lam S.L
2017-03-16fix `hoist_vars` on `reduce_vars` (#1607)...`hoist_vars` converts variable declarations into plain assignments, which then confuses `reduce_vars` fixes #1606Alex Lam S.L
2017-03-16fix stack issues with `AST_Node.evaluate()` (#1603)...As patched in #1597, `make_node_from_constant()` makes inconsistent and sometimes incorrect calls to `optimize()` and `transform()`. Fix those issues properly by changing the semantics of `evaluate()` and `make_node_from_constant()`, with the side effect that `evaluate()` no longer eagerly converts constant to `AST_Node`.Alex Lam S.L
2017-03-15fix `AST_Node.optimize()` (#1602)...Liberal use of `Compressor.transform()` and `AST_Node.optimize()` presents an issue for look-up operations like `TreeWalker.in_boolean_context()` and `TreeWalker.parent()`. This is an incremental fix such that `AST_Node.optimize()` would now contain the correct stack information when called correctly.Alex Lam S.L
2017-03-14minor clean-ups (#1600)...- remove obsolete optimisation in `AST_Binary` after #1477 - improve `TreeWalker.has_directive()` readability and resilience against multiple visitsAlex Lam S.L
2017-03-11v2.8.12Alex Lam S.L
2017-03-11temporary fix for boolean bug (#1597)...fixes #1592Alex Lam S.L
2017-03-11disallow parameter substitution for named IIFEs (#1596)...Self-referenced function has non-fixed values assigned to its parameters. Let `unused` & `!keep_fnames` do the scanning, then apply `reduce_vars` only to unnamed functions. fixes #1595Alex Lam S.L
2017-03-10support multi-line string in tests (#1590)...`expect_exact` sometimes have multiple lines and `\n` are hard to read. Use array of strings to emulate line breaks and improve readability.Alex Lam S.L
2017-03-10fixup for #1585 (#1589)...As patched on `harmony`, `statement()` is the only user of `embed_tokens()` with a missing error branch. Updated test case and match up with `harmony` to facilitate future merging.Alex Lam S.L
2017-03-10v2.8.11Alex Lam S.L
2017-03-10fix catch variable reference in IE8 (#1587)...`AST_Scope.def_variable()` will overwrite `AST_Symbol.thedef`, so save a copy before calling. fixes #1586Alex Lam S.L
2017-03-10Correctly raise a parse exception with a missing loop body (#1585)Michael Mior
2017-03-09fix & improve function argument compression (#1584)...- one-use function call => IIFE should take `eval()` & `arguments` into account - if unused parameter cannot be eliminated, replace it with `0` fixes #1583Alex Lam S.L
2017-03-09v2.8.10Alex Lam S.L
2017-03-09scan RHS of dropped assignments (#1581)...- similar case as #1578 but against #1450 instead - fix `this` binding in #1450 as well closes #1580Alex Lam S.L
2017-03-08remove checkboxes from Issues templateAlex Lam S.L
2017-03-08explain how to make a proper bug report (#1579)...fixes #1574Alex Lam S.L
2017-03-08scan assignment value in drop_unused() (#1578)...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 #1577Alex Lam S.L
2017-03-08v2.8.9Alex Lam S.L
2017-03-08fix function name eliminiation (#1576)...Function expression can be assigned to a variable and be given a name. Ensure function name is the reduced variable before clearing it out. fixes #1573 fixes #1575Alex Lam S.L
2017-03-08only run benchmark & jetstream on CI (#1571)Alex Lam S.L
2017-03-08plan B for IE8 do-while semi-colon fix (#1572)...- omitting trailing semi-colon in do-while breaks non-browser parser, e.g. uglify-js 1.x - trailing semi-colon only breaks IE8 if followed by `else` or `while` - always use braces in do-while body to workaround 2nd case with no size loss in compression fixes #1568Alex Lam S.L
2017-03-08fix return from recursive IIFE (#1570)...`side-effects` did not account for IIFEs being able to reference itself thus making its return value potentially significantAlex Lam S.L
2017-03-07v2.8.8Alex Lam S.L
2017-03-07include benchmark.js in test suite (#1564)...- report file sizes and overall run time - exit with non-zero code upon errorAlex Lam S.L
2017-03-07fix deep cloning of labels (#1565)...`AST_Label.references` get `.initialize()` to `[]` every time after `.clone()` So walk down the tree to pick up the cloned `AST_LoopControl` pieces and put it back together.Alex Lam S.L
2017-03-07transform function calls to IIFEs (#1560)...- expose function body to call sites for potential optimisations - suppress substitution of variable used within `AST_Defun`Alex Lam S.L
2017-03-07avoid substitution of global variables (#1557)...- unless `toplevel` is enabled - global `const` works as beforeAlex Lam S.L
2017-03-07collapse_vars: do not replace a constant in loop condition or init (#1562)kzc
2017-03-06suppress semicolons after do/while (#1556)...- unless both `beautify` & `screw-ie8` are enabled - deprecate workaround for if-do-while-else fixes #186Alex Lam S.L
2017-03-05v2.8.7Alex Lam S.L
2017-03-05fixup for #1553 (#1555)...- `++a` is the one that is foldable - transform `a++` into `++a` for better optimisationAlex Lam S.L
2017-03-05v2.8.6Alex Lam S.L
2017-03-05collapse assignment with adjacent subsequent usage (#1553)...- consolidate `cascade` optimisations - support ++/-- postfixes - remove redundant optimisation identified in #1460 fixes #368Alex Lam S.L
2017-03-05handle variable declaration within catch blocks (#1546)...accounts for IE8- scopingAlex Lam S.L
2017-03-05improve `unsafe` on undefined (#1548)...`unsafe` turns undefined keyword into a variable of the same name if found, but that interferes with other related optimisations. Keep track of such transformations to ensure zero information loss in the process.Alex Lam S.L
2017-03-05stay safe with constants in IE8- (#1547)...- `undefined` etc. can be redefined at top-level for IE8-, so disable related optimisations - fixed `--support-ie8` catch mangle bugAlex Lam S.L
2017-03-05fix handling of shebang and preamble (#1545)...fixes #1332Alex Lam S.L
2017-03-05fix a corner case in #1530 (#1552)Alex Lam S.L
2017-03-05resolve issue with outdated version of async (#1549)...fixes #746Alex Lam S.L
2017-03-04disallow collapse_vars constant replacement in for-in statements (#1543)kzc
2017-03-03process code with implicit return statement (#1522)...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 #1293Alex Lam S.L
2017-03-03compress numerical expressions (#1513)...safe operations - `a === b` => `a == b` - `a + -b` => `a - b` - `-a + b` => `b - a` - `a+ +b` => `+b+a` associative operations (bit-wise operations are safe, otherwise `unsafe_math`) - `a + (b + c)` => `(a + b) + c` - `(n + 2) + 3` => `5 + n` - `(2 * n) * 3` => `6 * n` - `(a | 1) | (2 | d)` => `(3 | a) | b` fixes #412Alex Lam S.L
2017-03-03facilitate fix for #1531 (#1542)Alex Lam S.L
2017-03-03v2.8.5Alex Lam S.L
2017-03-03fix chained assignment with `unused` (#1540)...When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused. fixes #1539Alex Lam S.L