Age | Commit message (Collapse) | Author |
|
- unless both `beautify` & `screw-ie8` are enabled
- deprecate workaround for if-do-while-else
fixes #186
|
|
|
|
- `++a` is the one that is foldable
- transform `a++` into `++a` for better optimisation
|
|
|
|
- consolidate `cascade` optimisations
- support ++/-- postfixes
- remove redundant optimisation identified in #1460
fixes #368
|
|
accounts for IE8- scoping
|
|
`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.
|
|
- `undefined` etc. can be redefined at top-level for IE8-, so disable related optimisations
- fixed `--support-ie8` catch mangle bug
|
|
fixes #1332
|
|
|
|
fixes #746
|
|
|
|
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
|
|
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
|
|
|
|
|
|
When #1450 optimises `a=b=42`, it stops after the first variable even if both are unused.
fixes #1539
|
|
fixes #1537
|
|
|
|
fixes #1533
|
|
- fails to handle `break` in body
fixes #1532
|
|
|
|
|
|
- "" + "a" => "a"
- "" + a + "b" => a + "b"
- "a" + "" => "a" (improving on #45)
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
... as we investigate #1516
|
|
- consolidate `side-effects` optimisations
- improve string `+` optimisation
- enhance literal & `conditionals` optimisations
|
|
|
|
- better inheritance of `Error` sub-classes
- mark parse error against source in CLI
closes #235
closes #348
closes #524
closes #1356
closes #1405
|
|
|
|
- convert `[].forEach()` to for-loops
|
|
- improve marking efficiency
- apply smarter `const` replacement to `var`
fixes #1501
|
|
closes #1362
closes #1399
|
|
- limited to one input file (or `stdin`)
- only works with built-in parser
fixes #520
|
|
Makes direct usage within web browser easier, even if officially unsupported.
|
|
2.8.0 staging
|
|
- fix corner cases in `const` optimisation
- deprecate `/*@const*/`
fixes #1497
closes #1498
|
|
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
|
|
fixes #1492
closes #1493
|
|
- only drops side-effect-free arguments
- drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement`
closes #1494
|
|
- never exceed specified limit
- otherwise warning is shown
- enabled only for final output
closes #1496
|
|
- `Array.prototype.slice` => `[].slice`
closes #1491
|
|
fixes #1377
closes #1488
|