https://github.com/mishoo/UglifyJS
Revision 18059cc94fdc037e296a1cb1b08143d5e3aae570 authored by Alex Lam S.L on 03 March 2017, 10:04:32 UTC, committed by GitHub on 03 March 2017, 10:04:32 UTC
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
1 parent b5e0e8c
History
Tip revision: 18059cc94fdc037e296a1cb1b08143d5e3aae570 authored by Alex Lam S.L on 03 March 2017, 10:04:32 UTC
compress numerical expressions (#1513)
Tip revision: 18059cc
File Mode Size
bin
lib
test
tools
.gitattributes -rw-r--r-- 20 bytes
.gitignore -rw-r--r-- 35 bytes
.travis.yml -rw-r--r-- 150 bytes
LICENSE -rw-r--r-- 1.3 KB
README.md -rw-r--r-- 40.3 KB
appveyor.yml -rw-r--r-- 350 bytes
package.json -rw-r--r-- 1.3 KB

README.md

back to top