Alex Lam S.L
6fa3fbeae8
compress chained compound assignments ( #2850 )
2018-01-29 15:13:25 +08:00
Alex Lam S.L
193612ac67
fix accounting after conversion to assignment ( #2847 )
...
Missing reference to `AST_SymbolRef` created by `unused` causes `collapse_vars` to misbehave.
fixes #2846
2018-01-26 14:21:11 +08:00
Alex Lam S.L
ec4202590d
drop assignments to constant expressions only ( #2839 )
...
fixes #2838
2018-01-23 02:49:54 +08:00
Alex Lam S.L
5e2cd07d6f
handle duplicate function declarations correctly ( #2837 )
...
fixes #2836
2018-01-23 01:28:09 +08:00
Alex Lam S.L
e2dc9cf091
fix unsafe evaluate of AST_Array ( #2825 )
...
fixes #2822
2018-01-21 01:39:44 +08:00
Alex Lam S.L
069df27bf1
enable unsafe for test/ufuzz.js ( #2819 )
...
- introduce `unsafe_undefined`
- safer `.toString()` compression
Miscellaneous
- rename `unsafe_Function`
2018-01-19 23:47:42 +08:00
Alex Lam S.L
3e7873217c
improve unused on built-in functions ( #2817 )
2018-01-19 20:41:57 +08:00
Alex Lam S.L
e21bab7ce6
avoid duplicate property names in object literals under "use strict" ( #2818 )
...
fixes #2816
2018-01-19 20:13:50 +08:00
Alex Lam S.L
ac9a168fba
fix & improve test/ufuzz.js ( #2815 )
...
- use correct `options` when testing `rename`
- mask arbitrarily assigned function IDs to reduce rate of false positives
2018-01-19 16:51:59 +08:00
Alex Lam S.L
81b64549ce
fix time-out for respawned test/ufuzz.js ( #2814 )
2018-01-19 06:11:19 +08:00
Alex Lam S.L
082e004b87
compress undefined property names ( #2811 )
...
- enforce property names as string
- handle `void 0` as `undefined` in `hoist_props` & `reduce_vars`
2018-01-19 00:36:30 +08:00
kzc
983e69128b
fix join_vars property assignment for negative array index ( #2810 )
...
fixes #2790
2018-01-18 21:52:54 +08:00
Alex Lam S.L
b335912e86
enhance test/ufuzz.js ( #2808 )
...
- standalone test for `rename`
- handle `keep_fargs` & `rename` upon failure
2018-01-18 14:08:05 +08:00
Alex Lam S.L
07e4b64f3a
fix AST_Scope.clone() ( #2803 )
...
fixes #2799
2018-01-17 21:33:13 +08:00
Alex Lam S.L
d3ce2bc9e7
suppress unsafe_proto for LHS expressions ( #2804 )
2018-01-17 20:41:51 +08:00
Alex Lam S.L
cff3bf4914
configure rename with CLI ( #2802 )
2018-01-17 15:12:22 +08:00
Alex Lam S.L
79cfac77bd
extend join_vars & sequences ( #2798 )
2018-01-17 13:58:27 +08:00
Alex Lam S.L
224c14d49d
improve mocha tests ( #2797 )
...
- workaround sporadic delays from Travis CI
2018-01-16 17:51:25 +08:00
Alex Lam S.L
7857354d85
improve test/travis-ufuzz.js ( #2795 )
...
- print usage
- support concurrent jobs
- improve instance utilisation
- resume after V8 self-destruct
2018-01-16 17:33:21 +08:00
Alex Lam S.L
b4aef753e7
general improvements around AST_ForIn ( #2796 )
...
- compress using `collapse_vars`
- remove unused `name`
- simplify `loop_body`
2018-01-16 17:03:12 +08:00
Alex Lam S.L
ec7cd1dcf7
handle VM failure gracefully ( #2791 )
2018-01-15 23:41:39 +08:00
Alex Lam S.L
7def684730
improve test/travis-ufuzz.js ( #2789 )
...
- wait for instance to boot
- run on forked repositories
- workaround `request_limit_reached`
2018-01-15 19:18:21 +08:00
Alex Lam S.L
10f961c27b
enhance collapse_vars ( #2788 )
2018-01-15 18:47:23 +08:00
Alex Lam S.L
cbbe6fad60
avoid double counting within single-use functions ( #2785 )
...
fixes #2783
2018-01-15 16:42:15 +08:00
Alex Lam S.L
f96929c031
improve test/travis-ufuzz.js ( #2786 )
...
- use more RAM
- show progress in console
- report failure as job status
2018-01-15 15:08:35 +08:00
Alex Lam S.L
2b6657e967
run test/ufuzz.js when Travis CI is idle ( #2784 )
2018-01-15 08:52:11 +08:00
Alex Lam S.L
62a66dfff4
fix & extend join_vars for object assigments ( #2781 )
2018-01-14 17:11:31 +08:00
Alex Lam S.L
e49416e4aa
fix reduce_vars on AST_Accessor ( #2776 )
...
fixes #2774
2018-01-13 02:46:14 +08:00
Alex Lam S.L
b757450cd8
fix nested unused assignments ( #2769 )
...
fixes #2768
2018-01-11 23:13:44 +08:00
Alex Lam S.L
23ec484806
fix corner case in #2763 ( #2766 )
2018-01-11 21:18:08 +08:00
Alex Lam S.L
f1e1bb419a
join object assignments ( #2763 )
2018-01-11 17:08:21 +08:00
Alex Lam S.L
09269be974
enhance conditionals ( #2758 )
...
`x ? y || z : z` --> `x && y || z`
2018-01-10 16:59:57 +08:00
Alex Lam S.L
bf832cde16
improve synergy between compress and rename ( #2755 )
2018-01-09 17:55:41 +08:00
Alex Lam S.L
2972d58dbb
patch variable declaractions extracted within catch ( #2753 )
...
fixes #2749
2018-01-09 13:54:35 +08:00
Alex Lam S.L
2e22d38a02
improve rename reproducibility ( #2754 )
...
fixes #2752
2018-01-09 13:53:05 +08:00
Alex Lam S.L
ce27bcd69a
compress loops with immediate break ( #2746 )
...
fixes #2740
2018-01-08 14:30:18 +08:00
Alex Lam S.L
9809567dfc
improve process.exit() workaround ( #2741 )
...
- use public API
- fix issue with Node.js 0.10 on WIndows
2018-01-07 17:53:50 +08:00
Alex Lam S.L
1ee8be8d91
fix recursive function inline ( #2738 )
...
fixes #2737
2018-01-07 15:31:24 +08:00
Alex Lam S.L
659c8a7632
handle trailing line comments correctly ( #2736 )
...
fixes #2734
2018-01-06 21:05:21 +08:00
Alex Lam S.L
3564b4f20d
compress RegExp() in unsafe ( #2735 )
2018-01-06 21:04:47 +08:00
Alex Lam S.L
3505a3604a
enhance unsafe_proto ( #2733 )
2018-01-06 06:16:51 +08:00
kzc
9b1bc6c014
ufuzz: add strings "a", "b", "c" to VALUES ( #2732 )
2018-01-06 05:54:53 +08:00
Alex Lam S.L
9f23185f2b
fix corner case with arguments as function name ( #2729 )
...
fixes #2728
2018-01-05 22:21:18 +08:00
Alex Lam S.L
b82feb9302
improve if_return ( #2727 )
2018-01-05 20:24:30 +08:00
Alex Lam S.L
7f2a591c7e
warn on deprecated features ( #2726 )
...
- `function.arguments`
- `function.callers`
fixes #2719
2018-01-05 19:36:02 +08:00
Alex Lam S.L
afbcebddf6
fix mangle name collision across files ( #2722 )
2018-01-05 05:08:09 +08:00
Alex Lam S.L
484e484571
fix corner case in inline ( #2720 )
2018-01-04 23:38:37 +08:00
Alex Lam S.L
6f3f21233f
reminify tests upon expect_stdout ( #2716 )
2018-01-04 20:13:05 +08:00
Alex Lam S.L
a6873a3859
forbid block-scoped AST_Defun in strict mode ( #2718 )
2018-01-04 18:45:51 +08:00
Alex Lam S.L
7a6d452b54
preserve constant modification under strict mode ( #2717 )
2018-01-04 15:53:53 +08:00
Alex Lam S.L
9b58b54e2d
extend inline ( #2714 )
...
- compress `function` with variables within loops
- restrict to `AST_Var` for better compatibility with ES6+
2018-01-04 12:58:40 +08:00
Alex Lam S.L
c598a12af9
apply collapse_vars to loop conditions ( #2712 )
2018-01-04 03:18:28 +08:00
Alex Lam S.L
cfe3a98ce5
drop unused assignment based on reduce_vars ( #2709 )
2018-01-04 01:03:33 +08:00
Alex Lam S.L
14778e049b
fix reduce_vars on AST_Defun ( #2708 )
2018-01-03 17:18:38 +08:00
Alex Lam S.L
446fb0198b
extend __PURE__ to AST_New ( #2706 )
...
fixes #2705
2018-01-03 04:48:07 +08:00
Alex Lam S.L
7d3cddf9d6
inline functions with AST_Var ( #2688 )
2018-01-03 01:54:44 +08:00
Alex Lam S.L
6dead95eb3
enhance collapse_vars ( #2704 )
2018-01-02 18:42:15 +08:00
Alex Lam S.L
cc931b3ad8
enhance if_return ( #2703 )
2018-01-02 15:09:51 +08:00
Alex Lam S.L
d838b4b52e
reset argument value within loop after inline ( #2699 )
2018-01-02 01:24:53 +08:00
Alex Lam S.L
2f3bddbaca
scan within IIFEs of assigned values ( #2702 )
...
fixes #2701
2018-01-02 01:24:23 +08:00
Alex Lam S.L
673b071637
enhance join_vars & sequences ( #2697 )
...
- nudge declarations without assignments
- within `AST_BlockStatement`
- across `AST_If`
2018-01-01 00:09:26 +08:00
Alex Lam S.L
da82fa59a7
fix inline on duplicate argument names ( #2698 )
2017-12-31 20:59:58 +08:00
Alex Lam S.L
333792352e
reduce hoisting declarations ( #2687 )
2017-12-31 16:15:00 +08:00
Alex Lam S.L
ed7a0a454e
fix dead_code on escaped return assignment ( #2693 )
...
fixes #2692
2017-12-30 15:20:25 +08:00
Alex Lam S.L
b95e3338d9
fix pure_getters on AST_Binary ( #2681 )
...
fixes #2678
2017-12-28 17:01:01 +08:00
Alex Lam S.L
e40a0ee9c6
improve assignment variations ( #2671 )
2017-12-28 15:36:55 +08:00
Alex Lam S.L
cb62bd98d3
fix function inlining within loops ( #2675 )
...
fixes #2663
2017-12-28 02:53:14 +08:00
Alex Lam S.L
f30790b11b
fix dead_code on return assignments ( #2668 )
...
fixes #2666
2017-12-27 07:40:34 +08:00
Alex Lam S.L
5205dbcbf4
retain recursive function names ( #2667 )
...
fixes #2665
2017-12-27 07:00:12 +08:00
Alex Lam S.L
3ff625de7e
fix bugs on substituted AST_Defun ( #2661 )
...
fixes #2660
2017-12-27 05:31:37 +08:00
Alex Lam S.L
4832bc5d88
replace single-use recursive functions ( #2659 )
...
fixes #2628
2017-12-26 21:25:35 +08:00
Alex Lam S.L
7f342cb3e3
suppress inline within substituted AST_Scope ( #2658 )
...
fixes #2657
2017-12-26 18:56:59 +08:00
Alex Lam S.L
05e7d34ed4
improve unused over duplicate variable names ( #2656 )
2017-12-26 18:29:28 +08:00
Alex Lam S.L
0fe259e9c5
parse LF & comment correctly ( #2653 )
...
fixes #2652
2017-12-26 01:38:01 +08:00
Alex Lam S.L
1476c78b53
add html-minifier to benchmarks ( #2646 )
2017-12-25 03:07:46 +08:00
Alex Lam S.L
cb6a92892f
fix infinite loop during inline ( #2645 )
...
fixes #2644
2017-12-25 01:57:11 +08:00
Alex Lam S.L
efffb81735
fix comments output & improve /*@__PURE__*/
...
- fix whitespace around comments
- fix comment parsing around parentheses
- consider parentheses when parsing `/*@__PURE__*/`
- remove all `/*@__PURE__*/` on output
fixes #2638
2017-12-24 12:38:45 +08:00
Alex Lam S.L
202f90ef8f
fix corner cases with collapse_vars, inline & reduce_vars ( #2637 )
...
fixes #2630
2017-12-24 01:24:12 +08:00
Alex Lam S.L
c07ea17c01
fix escape analysis on AST_PropAccess ( #2636 )
2017-12-24 00:36:46 +08:00
Alex Lam S.L
edb4e3bd52
make comments output more robust ( #2633 )
...
- improve handling of comments right after `return`
- retain comments after `OutputStream`
- preserve trailing comments
- fix handling of new line before comments
- handle comments around parentheses
fixes #88
fixes #112
fixes #218
fixes #372
fixes #2629
2017-12-22 04:59:54 +08:00
Alex Lam S.L
4113609dd4
extend test/ufuzz.js to inline & reduce_funcs ( #2620 )
...
- forward call `fN()`
- allow forward call functions to be single-use
- avoid generating `AST_Defun` within blocks
2017-12-20 23:52:18 +08:00
Alex Lam S.L
86ae5881b7
disable hoist_funs by default ( #2626 )
2017-12-20 17:05:40 +08:00
Alex Lam S.L
fac003c64f
avoid inline of function with special argument names ( #2625 )
2017-12-20 02:48:04 +08:00
Alex Lam S.L
2273655c17
fix inline after single-use reduce_vars ( #2623 )
2017-12-19 22:19:33 +08:00
Alex Lam S.L
032f096b7f
add test for #2613 ( #2618 )
2017-12-19 05:22:05 +08:00
Alex Lam S.L
4b334edf49
handle global constant collision with local variable after inline ( #2617 )
...
fixes #2616
2017-12-19 03:05:30 +08:00
Alex Lam S.L
8ddcbc39e6
compress apply() & call() of function ( #2613 )
...
- `fn.apply(a, [ ... ])` => `fn.call(a, ...)`
- `fn.call(a, ... )` => `a, fn(...)`
where `fn` can be `function` literal or symbol reference linked through `reduce_vars`
2017-12-18 16:23:39 +08:00
Alex Lam S.L
0b0eac1d5d
drop property assignment to constants ( #2612 )
2017-12-18 12:07:53 +08:00
Alex Lam S.L
b29fc8b27c
improve transversal efficiency in collapse_vars ( #2611 )
...
fixes #2603
2017-12-18 03:00:05 +08:00
Alex Lam S.L
21794c9b8d
account for catch variable when inline ( #2605 )
...
fixes #2604
2017-12-16 15:21:09 +08:00
Alex Lam S.L
6c686ce593
fix nested inline ( #2602 )
...
fixes #2601
2017-12-16 02:16:35 +08:00
Alex Lam S.L
db902af4c6
fix escape analysis on || and && ( #2600 )
...
fixes #2598
2017-12-15 19:48:14 +08:00
Alex Lam S.L
7d6907cb99
fix dead_code on nested try ( #2599 )
...
fixes #2597
2017-12-15 19:41:28 +08:00
Alex Lam S.L
092d9affb8
fix reduce_vars on do...while ( #2596 )
2017-12-15 16:33:19 +08:00
Alex Lam S.L
8f681b1d17
handle inline of function arguments ( #2590 )
...
fixes #2476
2017-12-15 13:28:30 +08:00
Alex Lam S.L
90313875f7
inline single-use function across loop ( #2594 )
2017-12-14 19:24:54 +08:00
Alex Lam S.L
3f18a61532
fix reduce_vars on single AST_Defun reference across loop ( #2593 )
2017-12-14 18:47:05 +08:00
Alex Lam S.L
02a6ce07eb
improve reduce_vars ( #2592 )
...
- account for hoisting nature of `var`
2017-12-14 15:32:13 +08:00
Alex Lam S.L
738fd52bc4
improve collapse_vars ( #2591 )
...
- handle single-use assignments other than `AST_VarDef`
- scan `AST_Call` for candidates
2017-12-14 15:31:35 +08:00
kzc
d18979bb23
improve dead_code tests ( #2589 )
...
for #2588
2017-12-14 12:12:06 +08:00