aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-05fixup for #1553 (#1555)Alex Lam S.L
- `++a` is the one that is foldable - transform `a++` into `++a` for better optimisation
2017-03-05v2.8.6Alex Lam S.L
2017-03-05collapse assignment with adjacent subsequent usage (#1553)Alex Lam S.L
- consolidate `cascade` optimisations - support ++/-- postfixes - remove redundant optimisation identified in #1460 fixes #368
2017-03-05handle variable declaration within catch blocks (#1546)Alex Lam S.L
accounts for IE8- scoping
2017-03-05improve `unsafe` on undefined (#1548)Alex Lam S.L
`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.
2017-03-05stay safe with constants in IE8- (#1547)Alex Lam S.L
- `undefined` etc. can be redefined at top-level for IE8-, so disable related optimisations - fixed `--support-ie8` catch mangle bug
2017-03-05fix handling of shebang and preamble (#1545)Alex Lam S.L
fixes #1332
2017-03-05fix a corner case in #1530 (#1552)Alex Lam S.L
2017-03-05resolve issue with outdated version of async (#1549)Alex Lam S.L
fixes #746
2017-03-04disallow collapse_vars constant replacement in for-in statements (#1543)kzc
2017-03-03process code with implicit return statement (#1522)Alex Lam S.L
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 #1293
2017-03-03compress numerical expressions (#1513)Alex Lam S.L
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 #412
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)Alex Lam S.L
When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused. fixes #1539
2017-03-03collapse_vars should not replace constant in for-in init section (#1538)kzc
fixes #1537
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)Alex Lam S.L
fixes #1533
2017-03-03disable do{...}while(false) optimisation (#1534)Alex Lam S.L
- fails to handle `break` in body fixes #1532
2017-03-02optimize trivial IIFEs returning constants (#1530)kzc
2017-03-02trim unused invocation parameters (#1526)Alex Lam S.L
2017-03-02minor improvement to string optimisation (#1514)Alex Lam S.L
- "" + "a" => "a" - "" + a + "b" => a + "b" - "a" + "" => "a" (improving on #45)
2017-03-02v2.8.4Alex Lam S.L
2017-03-02fix corner cases in `reduce_vars` (#1524)Alex Lam S.L
Avoid variable substitution in the following cases: - use of variable before declaration - declaration within conditional code blocks - declaration within loop body fixes #1518 fixes #1525
2017-03-01v2.8.3Alex Lam S.L
2017-03-01fix crash on missing `props` to `string_template()` (#1523)Alex Lam S.L
Patched up `make_node()` without `orig`. There may be other cases where `start` could be missing, so make it print "undefined" instead of crashing. fixes #1518
2017-03-01v2.8.2Alex Lam S.L
2017-03-01invert `reduce_vars` tracking flag (#1519)Alex Lam S.L
Modules like webpack and grunt-contrib-uglify still uses `ast.transform(compressor)` before `Compressor.compress(ast)` was introduced. Workaround this compatibility issue by deactivating `reduce_vars` in such case. Also fix use case with omitted `options` when calling `Compressor()`. fixes #1516
2017-03-01fix `evaluate` on object getter & setter (#1515)Alex Lam S.L
2017-03-01v2.8.1Alex Lam S.L
2017-03-01temporarily disables `reduce_vars` (#1517)Alex Lam S.L
... as we investigate #1516
2017-02-28warn & drop `#__PURE__` iff IIFE is dropped (#1511)Alex Lam S.L
- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisations
2017-02-27v2.8.0Alex Lam S.L
2017-02-27improve error messages (#1506)Alex Lam S.L
- better inheritance of `Error` sub-classes - mark parse error against source in CLI closes #235 closes #348 closes #524 closes #1356 closes #1405
2017-02-27add harmony branch details in README (#1507)kzc
2017-02-26faster tree transversal (#1462)Alex Lam S.L
- convert `[].forEach()` to for-loops
2017-02-26consolidate `evaluate` & `reduce_vars` (#1505)Alex Lam S.L
- improve marking efficiency - apply smarter `const` replacement to `var` fixes #1501
2017-02-25update docs for `pure_funcs` & `drop_console` (#1503)Alex Lam S.L
closes #1362 closes #1399
2017-02-25allow --in-source-map inline (#1490)Alex Lam S.L
- limited to one input file (or `stdin`) - only works with built-in parser fixes #520
2017-02-24Avoid using exports when undefined (#1471)Ondřej Španěl
Makes direct usage within web browser easier, even if officially unsupported.
2017-02-24Merge pull request #1485 from alexlamsl/merge-2.8.0Alex Lam S.L
2.8.0 staging
2017-02-24enable `collapse_vars` & `reduce_vars` by defaultalexlamsl
- fix corner cases in `const` optimisation - deprecate `/*@const*/` fixes #1497 closes #1498
2017-02-21Support marking a call as purekzc
A function call or IIFE with an immediately preceding comment containing `@__PURE__` or `#__PURE__` is deemed to be a side-effect-free pure function call and can potentially be dropped. Depends on `side_effects` option. `[#@]__PURE__` hint will be removed from comment when pure call is dropped. fixes #1261 closes #1448
2017-02-21Fix: AST_Accessor missing start / end tokensOndřej Španěl
fixes #1492 closes #1493
2017-02-21fix `pure_funcs` & improve `side_effects`alexlamsl
- only drops side-effect-free arguments - drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement` closes #1494
2017-02-21clean up `max_line_len`alexlamsl
- never exceed specified limit - otherwise warning is shown - enabled only for final output closes #1496
2017-02-21introduce `unsafe_proto`alexlamsl
- `Array.prototype.slice` => `[].slice` closes #1491
2017-02-21remove extraneous spaces between ++/+/--/-alexlamsl
fixes #1377 closes #1488
2017-02-21Add .gitattributes to checkout lf eol styleAnthony Van de Gejuchte
closes #1487
2017-02-21improve `--beautify bracketize`alexlamsl
reduce whitespaces from if-else statements fixes #1482 closes #1483