Age | Commit message (Expand) | Author |
2018-07-01 | fix corner case in `unused` | alexlamsl |
2017-11-11 | implement compress option `reduce_funcs` (#2466)...- inline single-use function declarations as expressions when permissible
- depend on `reduce_vars`
- enabled by default
- disable for speed critical code
fixes #2464 | Alex Lam S.L |
2017-10-27 | fix `reduce_vars` on `AST_Array.length` (#2404) | Alex Lam S.L |
2017-10-22 | fix `unsafe` escape analysis in `reduce_vars` (#2387) | Alex Lam S.L |
2017-02-21 | improve string concatenation...shuffle associative operations to minimise parentheses and aid other uglification efforts
closes #1454
| 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-01-26 | update test (#1441)...improved reduce_vars & binary operands produce more optimal results | 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 |
2013-09-22 | More attempts to determine when addition is associative...Somebody hit me with bug reports on this. :)
Refs #300
| Mihai Bazon |
2013-09-22 | Actually let's move away those monsters from the evaluate function...ev() should do a single thing — evaluate constant expressions. if that's
not possible, just return the original node. it's not the best place for
partial evaluation there, instead doing it in the compress functions.
| Mihai Bazon |
2013-09-22 | More dirty handling of [ ... ].join() in unsafe mode...Close #300
| Mihai Bazon |
2013-09-22 | Evaluate [...].join() if possible: minor bugfix...Follow-up to 78e98d2.
| Dan Wolff |
2013-09-19 | When `unsafe` is set, evaluate [...].join() if possible...Close #298
| Mihai Bazon |
2013-07-18 | Fix output for arrays whose last element is a hole: [1,,]...1529ab96 started to do this (by considering holes to be separate from
"undefined") but it still converted
[1,,] (length 2, last element hole, trailing comma)
to
[1,] (length 1, trailing comma)
Unfortunately the test suite doesn't really make this clear: the new test here
passes with or without this patch because run-tests.js beautifys the expected
output (in "make_code"), which does the incorrect transformation! If you make
some manual change to arrays.js to make the test fail and see the INPUT and
OUTPUT, then you can see that without this fix, [1,,] -> [1,], and with this fix
it stays [1,,].
| David Glasser |
2013-01-17 | Fix output for arrays containing undefined values....1b6bcca7 was a first attempt at this. That commit made Uglify stop replacing
holes with undefined, but instead it started replacing undefined with
holes. This is slightly problematic, because there is a difference between a
hole and an undefined value. More problematically, it changed [1,undefined] to
[1,] which generally doesn't even parse as a hole (just as a trailing comma), so
it didn't even preserve the length of the array!
Instead, parse holes as their own special AST node which prints invisibly.
| David Glasser |