Alex Lam S.L
1e9ef17e32
Merge pull request #1892 from alexlamsl/harmony-v3.0.2
...
Merging from master for 3.0.2
harmony-v3.0.2
2017-05-10 03:14:45 +08:00
alexlamsl
222100ea4c
Merge branch 'master' into harmony-v3.0.2
2017-05-10 01:57:32 +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
93db48a317
rename package
2017-05-10 01:46:55 +08:00
Alex Lam S.L
2944e3df7d
fix collapse_vars on destructuring declarations ( #1889 )
...
fixes #1886
2017-05-09 17:44:28 +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
Alex Lam S.L
e0ae8da089
Merge pull request #1885 from alexlamsl/harmony-v3.0.1
...
Merging from master for 3.0.1
harmony-v3.0.1
2017-05-09 02:49:28 +08:00
alexlamsl
81f1311b24
Merge branch 'master' into harmony-v3.0.1
2017-05-09 02:10:06 +08:00
Alex Lam S.L
2433bb4e52
fix Unicode handling in parser ( #1884 )
...
There was an implicit assumption that first character within surrogate header range implies the next character must form a surrogate pair, which is not necessarily true.
2017-05-09 01:58:31 +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
3fac29a017
Merge pull request #1876 from alexlamsl/harmony-v3.0.0
...
Merging from master for 3.0.0
harmony-v3.0.0
2017-05-08 01:44:07 +08:00
alexlamsl
b4c18f6b83
Merge branch 'master' into harmony-v3.0.0
2017-05-07 15:34:16 +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
73d6438773
fix \\n and \\r in template strings ( #1857 )
...
fixes #1856
2017-04-30 17:05:32 +08:00
kzc
5c6316a37d
fix class method formatting ( #1853 )
...
fixes #1852
2017-04-29 18:13:25 +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