aboutsummaryrefslogtreecommitdiff
path: root/test/compress/reduce_vars.js
AgeCommit message (Expand)Author
2017-06-06implement function inlining (#2053)...- empty body - single `AST_Return` - single `AST_SimpleStatement` - avoid `/*#__PURE__*/` Miscellaneous - enhance single-use function substitution fixes #281Alex Lam S.L
2017-06-04fix `AST_Function` scope invariance (#2052)...improve function name hack in `run_code()`Alex Lam S.L
2017-05-14fix bugs with getter/setter (#1926)...- `reduce_vars` - `side_effects` - property access for object - `AST_SymbolAccessor` as key names enhance `test/ufuzz.js` - add object getter & setter - property assignment to setter - avoid infinite recursion in setter - fix & adjust assignment operators - 50% `=` - 25% `+=` - 2.5% each for the rest - avoid "Invalid array length" - fix `console.log()` - bypass getter - curb recursive reference - deprecate `-E`, always report runtime errorsAlex Lam S.L
2017-05-12remove support for `const` (#1910)...As this is not part of ES5.Alex Lam S.L
2017-05-12avoid `arguments` and `eval` in `reduce_vars` (#1924)...fixes #1922Alex Lam S.L
2017-05-07fix test for #1865 (#1873)Alex Lam S.L
2017-05-06fix `unsafe` on `evaluate` of `reduce_vars` (#1870)...Determine if variables with non-constant values can escape and be modified. fixes #1865Alex Lam S.L
2017-04-30enforce `toplevel` on other compress options (#1855)...Respect "funcs" and "vars" properly. fixes #1850Alex Lam S.L
2017-04-20improve `unused` (#1832)...- extract leading value with side-effects out of `var` statement - reduce scanning of `AST_Definitions` from 3 passes to just onceAlex Lam S.L
2017-04-18support safe reassignments in `reduce_vars` (#1823)...`var a=1;a=2;x(a)` => `x(2)` fix pre-existing issues - reference counting on assignment - walking of anonymous functions - chained assignmentAlex Lam S.L
2017-04-18fix `reduce_vars` on conditionals (#1822)Alex Lam S.L
2017-04-17fix `reduce_vars` on boolean binary expressions (#1819)...Side effects of `&&` and `||` have not mattered until #1814, which takes assignment expressions into account.Alex Lam S.L
2017-04-17compress duplicated variable definitions (#1817)...These are surprisingly common, as people reuse the same variable name within loops or switch branches.Alex Lam S.L
2017-04-17fix `reduce_vars` within try-block (#1818)...Possible partial execution due to exceptions.Alex Lam S.L
2017-04-17enhance `reduce_vars` (#1814)...- allow immediate assignment after declaration of variable - relax modification rule for immutable value - fix order of visit for TreeWalker - remove extraneous codeAlex Lam S.L
2017-04-16fix variable substitution (#1816)...- let `collapse_vars` take care of value containing any symbols - improve overhead accountingAlex Lam S.L
2017-04-07introduce "strict" to `pure_getters` (#1795)Alex Lam S.L
2017-04-07fix `reduce_vars` on catch variable (#1794)...Improved catch handling in `figure_out_scope()` means special case treatment of IE8 is no longer valid in `reset_opt_flags()`. Also fixed recursive assignment in variable definition.Alex Lam S.L
2017-04-07fix incorrect context in variable substitution (#1791)...`AST_Node.optimize()` is context-aware, so don't cache its results to be used elsewhere. Also fixed a few cases of AST corruption and beef up safety of `pure_getters`.Alex Lam S.L
2017-04-02fix corner cases in switch and undefined (#1762)...- fix side effects in switch condition for singular blocks - fix `undefined` confusion with local variable - gate `OPT(AST_Switch)` with `switches` fixes #1758 fixes #1759Alex Lam S.L
2017-03-27handle overlapped variable definitions (#1691)...Process variable definitions with or without assigned values against: - `arguments` - named function arguments - multiple definitions within same scope Essentially demote variable declarations with no value assignments. Also fixed invalid use of `AST_VarDef` over `arguments` - should use a member of `AST_SymbolDeclaration` instead.Alex Lam S.L
2017-03-26fix `delete` related issues in `collapse_vars` and `reduce_vars` (#1689)Alex Lam S.L
2017-03-25fix `reduce_vars` on `AST_Switch` (#1671)...Take conditional nature of switch branches into account. fixes #1670Alex Lam S.L
2017-03-19make `expect_stdout` work on Node.js 0.12 (#1623)...That particular version of Node.js has messed up error messages, so provide a version-specific workaround. Also fixed an formatting issue which would cause `expect_stdout` to fail if error message contains excerpts of input. Apply `expect_stdout` to more applicable tests.Alex 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-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-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-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-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-05handle variable declaration within catch blocks (#1546)...accounts for IE8- scopingAlex Lam S.L
2017-03-03properly cover all cases of for-in loop variables (#1536)Alex Lam S.L
2017-03-03fix reference marking in for-in loops (#1535)...fixes #1533Alex Lam S.L
2017-03-02fix corner cases in `reduce_vars` (#1524)...Avoid variable substitution in the following cases: - use of variable before declaration - declaration within conditional code blocks - declaration within loop body fixes #1518 fixes #1525Alex Lam S.L
2017-02-26consolidate `evaluate` & `reduce_vars` (#1505)...- improve marking efficiency - apply smarter `const` replacement to `var` fixes #1501Alex Lam S.L
2017-02-21improve reduce_vars and fix a bug...- update modified flag between compress() passes - support IIFE arguments - fix corner case with multiple definitions closes #1473 alexlamsl
2017-01-26optimise 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-26augment 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 functionsAlex Lam S.L
2016-10-01Optimize unmodified variablesalexlamsl