Alex Lam S.L
daaefc17b9
v3.0.4
v3.0.4
2017-05-12 04:52:39 +08:00
Alex Lam S.L
1d407e761e
fix invalid transform on const ( #1919 )
...
- preserve (re)assignment to `const` for runtime error
- suppress `cascade` on `const`, as runtime behaviour is ill-defined
2017-05-12 04:51:44 +08:00
kzc
2b44f4ae30
update README ( #1918 )
2017-05-12 03:36:33 +08:00
Alexis Tyler
e51c3541da
fix typo ( #1913 )
2017-05-11 20:24:33 +08:00
Alex Lam S.L
3bf194684b
update documentation ( #1909 )
...
- clarify options on `--source-map`
- fix `minify()` examples
fixes #1905
2017-05-11 17:50:50 +08:00
Alex Lam S.L
aae7d49d0c
v3.0.3
v3.0.3
2017-05-10 11:45:03 +08:00
kzc
0459af2ecc
Update issue template: change harmony to uglify-es ( #1900 )
2017-05-10 11:07:54 +08:00
kzc
04f2344efc
Remove unnecessary git clone instructions in README ( #1897 )
2017-05-10 11:06:50 +08:00
kzc
bad9d5cf88
Change harmony to uglify-es in master README ( #1895 )
2017-05-10 05:07:45 +08:00
Alex Lam S.L
a0f5f862df
gracefully handle non-Error being thrown ( #1893 )
2017-05-10 04:20:59 +08:00
Alex Lam S.L
41996be86f
extend test timeout
...
Travis has gone a lot slower recently, and most test failures are due to time-out on this particular test.
2017-05-10 02:43:12 +08:00
Alex Lam S.L
5fd8244a2e
v3.0.2
v3.0.2
2017-05-10 01:52:00 +08:00
Alex Lam S.L
c14e280585
print error stack in CLI ( #1890 )
2017-05-09 16:36:44 +08:00
Alex Lam S.L
bc3fa78e8c
mention minify().error
2017-05-09 16:09:48 +08:00
Alex Lam S.L
8c7c107765
update minify() usage in test/ufuzz.js ( #1888 )
...
fixes #1887
2017-05-09 15:58:46 +08:00
kzc
3dd328dce3
[3.x] fix documentation for beautify options ( #1882 )
...
- use underscores rather than dashes.
2017-05-08 23:06:56 +08:00
Alex Lam S.L
014f428153
v3.0.1
v3.0.1
2017-05-08 07:05:57 +08:00
Alex Lam S.L
a3b2eb75bd
return Error from minify() ( #1880 )
...
Have `minify()` return `Error` in `result.error` rather than throwing it.
2017-05-08 07:05:19 +08:00
Alex Lam S.L
da295de82b
support dumping AST ( #1879 )
...
Re-order `AST_Binary` properties to make dump more readable.
closes #769
2017-05-08 06:23:01 +08:00
Alex Lam S.L
4f8ca4626e
deprecate low level API ( #1877 )
...
fixes #1872
2017-05-08 03:24:42 +08:00
Alex Lam S.L
e54748365c
support minify() output as AST ( #1878 )
...
- `options.output.ast` (default `false`)
- `options.output.code` (default `true`)
2017-05-08 02:11:45 +08:00
Alex Lam S.L
2d99d06601
update documentation
...
Remove deprecated CLI option
2017-05-07 03:02:46 +08:00
Alex Lam S.L
98cf95e5b5
fix test for #1865 ( #1873 )
2017-05-07 02:56:02 +08:00
Alex Lam S.L
7313465cba
v3.0.0
v3.0.0
2017-05-06 23:51:10 +08:00
Alex Lam S.L
2c7ee956fd
fix unsafe on evaluate of reduce_vars ( #1870 )
...
Determine if variables with non-constant values can escape and be modified.
fixes #1865
2017-05-06 23:18:55 +08:00
Alex Lam S.L
ecf3563c45
kill opera ( #1869 )
2017-05-06 17:42:07 +08:00
Alex Lam S.L
dee5a27516
enhance collapse_vars ( #1862 )
...
- extend expression types
- `a++`
- `a=x;`
- extend scan range
- `for(init;;);`
- `switch(expr){case expr:}`
- `a = x; a = a || y;`
- terminate upon `debugger;`
closes #1821
fixes #27
fixes #315
fixes #1858
2017-05-06 16:15:43 +08:00
Alex Lam S.L
5a25d24b56
rename variables for better readability ( #1863 )
2017-05-02 20:47:10 +08:00
Alex Lam S.L
bffdc8dca8
update test/benchmark.js resources ( #1864 )
2017-05-02 19:48:12 +08:00
Alex Lam S.L
69b5663653
restore report of supported options ( #1861 )
...
fixes #1859
2017-05-02 01:42:29 +08:00
kzc
ea9289771b
improve literal return optimization ( #1860 )
2017-05-02 00:10:11 +08:00
Alex Lam S.L
2cb55b2ad0
enforce toplevel on other compress options ( #1855 )
...
Respect "funcs" and "vars" properly.
fixes #1850
2017-04-30 22:52:36 +08:00
kzc
bbb5f2a89c
Update ISSUE_TEMPLATE.md ( #1846 )
2017-04-26 01:30:43 +08:00
Alex Lam S.L
76d19b60ad
fix fuzzer on this ( #1842 )
...
- forbid redeclaration of `this`
- suppress probability for `this` within nested functions
2017-04-24 03:15:03 +08:00
Alex Lam S.L
9e62628171
fix unused on for-in statements ( #1843 )
...
Only need to avoid `var` within the initialisation block.
fixes #1841
2017-04-24 03:14:01 +08:00
Alex Lam S.L
9bf72cf758
improve parser under "use strict" ( #1836 )
...
- `const` without value
- `delete` of expression
- redefining `arguments` or `eval`
extend `test/ufuzz.js`
- optionally generate "use strict"
- improve handling of test cases with syntax errors
- group IIFE generation
- generate bare anonymous functions
- workaround `console.log()` for `new function()`
- generate expressions with `this`
fixes #1810
2017-04-23 20:05:22 +08:00
kzc
64d74432f6
update README for 3.x ( #1840 )
2017-04-23 04:28:32 +08:00
Alex Lam S.L
45ce369480
fix AST_For.init patch-up in drop_unused() ( #1839 )
...
fixes #1838
2017-04-23 01:51:56 +08:00
Alex Lam S.L
ca32a09032
fix label-related bugs ( #1835 )
...
- deep cloning of `AST_LabeledStatement`
- `L:do{...}while(false)`
- empty statement with label within block
extend `test/ufuzz.js`
- generate labels for blocks & loops
- generate for-in statements
- skip suspicious option search if `minify()` errs
fixes #1833
2017-04-22 22:15:04 +08:00
Roman Dvornov
6f954aa3d0
Fix API reference examples ( #1834 )
2017-04-21 02:23:41 +08:00
Alex Lam S.L
f05d4f7af3
improve unused ( #1832 )
...
- extract leading value with side-effects out of `var` statement
- reduce scanning of `AST_Definitions` from 3 passes to just once
2017-04-20 13:06:14 +08:00
Alex Lam S.L
88e7a542cd
fix unused on labeled for-loop ( #1831 )
...
fixes #1830
2017-04-20 04:18:38 +08:00
Alex Lam S.L
4dcff038cb
improve collapse_vars on AST_Var ( #1828 )
...
Perform the same cascaded scanning within `var` statement as we do on array of statements.
2017-04-19 04:49:09 +08:00
Alex Lam S.L
b4b9305db0
fix parser bugs & CLI reporting ( #1827 )
...
fixes #1825
2017-04-19 04:27:13 +08:00
Alex Lam S.L
28cfb65c47
extend cascade into a.b ( #1829 )
...
fixes #27
2017-04-19 04:17:15 +08:00
Alex Lam S.L
0f4f01b66c
clean up collapse_vars ( #1826 )
...
- remove overlap in functionality of singular, consecutive reference of constant value
- remove workarounds for previous bugs in `lib/scope.js`
- distribute recursive `collapse_single_use_vars()` calls to their respective `OPT(AST_Node)`
- enable collapsing of variables within a single `AST_Definitions`
2017-04-18 21:45:34 +08:00
Alex Lam S.L
5d9f1da3ab
support 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 assignment
2017-04-18 13:38:42 +08:00
Alex Lam S.L
d1aa09c5c7
fix reduce_vars on conditionals ( #1822 )
2017-04-18 01:44:23 +08:00
Alex Lam S.L
6d5f341999
fix reduce_vars on boolean binary expressions ( #1819 )
...
Side effects of `&&` and `||` have not mattered until #1814 , which takes assignment expressions into account.
2017-04-17 17:24:29 +08:00
Alex Lam S.L
4ffb6fce76
compress duplicated variable definitions ( #1817 )
...
These are surprisingly common, as people reuse the same variable name within loops or switch branches.
2017-04-17 17:11:29 +08:00