alexlamsl
5ffc17d4aa
fix corner case in unused
2018-07-01 14:34:42 +08:00
Alex Lam S.L
9e19e63551
general clean-ups ( #3175 )
2018-06-06 17:50:56 +08:00
Alex Lam S.L
4fc39d8dad
fix corner case in collapse_vars ( #3139 )
2018-05-19 05:45:14 +08:00
Alex Lam S.L
f37b91879f
fix various corner cases ( #3123 )
2018-05-05 13:17:50 +08:00
Alex Lam S.L
70d4477e05
workaround vm context issue in node-chakracore ( #3106 )
2018-04-27 07:40:34 +08:00
Alex Lam S.L
9e87edfc2e
better fix for #2506 ( #3099 )
2018-04-25 04:46:07 +08:00
Alex Lam S.L
27211cf2d5
handle RHS side-effects in collapse_vars ( #3097 )
...
fixes #3096
2018-04-24 20:31:50 +08:00
Alex Lam S.L
06b9894c19
handle modifications to this correctly ( #3036 )
...
fixes #3032
2018-03-30 15:07:36 +09:00
Alex Lam S.L
ccf0e2ef4f
extend fuzzy RHS folding ( #3006 )
...
- `a = []; if (1) x();` => `if (a = []) x();`
2018-03-17 03:10:21 +08:00
Alex Lam S.L
fe51a91395
handle negated constants correctly in collapse_vars ( #2975 )
...
fixes #2974
2018-03-06 00:45:58 +08:00
Alex Lam S.L
0daa199fa8
migrate safe transformations out of unsafe_comps ( #2962 )
...
fixes #2959
2018-02-28 22:02:24 +08:00
Alex Lam S.L
73e98dcda4
drop side_effects-free return values ( #2965 )
2018-02-28 19:59:19 +08:00
Alex Lam S.L
36bca6934d
enhance collapse_vars ( #2952 )
...
- `a = b, b` => `a = b`
- `a.b = c, c()` => `(a.b = c)()`
2018-02-28 15:19:32 +08:00
Alex Lam S.L
b8b2ac5230
improve fix for #2954 ( #2958 )
2018-02-26 03:14:22 +08:00
Alex Lam S.L
ea2359381b
fix collapse_vars on nested exception ( #2955 )
...
fixes #2954
2018-02-25 15:39:00 +08:00
Alex Lam S.L
4b5993ff15
fix crash in may_throw() ( #2932 )
...
fixes #2931
2018-02-18 21:51:27 +08:00
Alex Lam S.L
7fdd2082a6
drop unused "class" definition IIFEs ( #2923 )
...
fixes #805
2018-02-17 05:11:31 +08:00
Alex Lam S.L
83d8aa8b12
fix collapse_vars within loops ( #2915 )
...
fixes #2914
2018-02-14 05:15:52 +08:00
Alex Lam S.L
0c4f315c02
fix corner case in collapse_vars ( #2909 )
...
fixes #2908
2018-02-13 01:41:22 +08:00
Alex Lam S.L
d66d86f20b
account for exceptions in AST_Assign.left ( #2892 )
...
fixes #2891
2018-02-08 03:31:51 +08:00
Alex Lam S.L
3026bd8975
improve exceptional flow compression by collapse_vars ( #2880 )
2018-02-04 04:18:22 +08:00
Alex Lam S.L
78a44d5ab0
maintain order between side-effects and externally observable assignments ( #2879 )
...
fixes #2878
2018-02-04 03:58:49 +08:00
Alex Lam S.L
7e13c0db40
handle break & continue in collapse_vars ( #2875 )
...
fixes #2873
2018-02-03 07:58:43 +08:00
Alex Lam S.L
e6a2e9e4d0
allow collapse_vars across conditional branches ( #2867 )
2018-02-03 02:44:40 +08:00
Alex Lam S.L
b16380d669
fix missing corner case in #2855 ( #2868 )
2018-02-02 18:08:56 +08:00
Alex Lam S.L
102f994b9d
account for declaration assignment in collapse_vars ( #2859 )
...
fixes #2858
2018-02-01 15:09:53 +08:00
Alex Lam S.L
2a4c68be4f
relax collapse_vars on AST_Exit ( #2855 )
...
First introduced in #1862 to stop assignments to migrate beyond `return` or `throw`. Since then `collapse_vars` has been improved to handle various side-effect-related corner cases.
2018-01-31 23:49:59 +08:00
Alex Lam S.L
6fa3fbeae8
compress chained compound assignments ( #2850 )
2018-01-29 15:13:25 +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
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
10f961c27b
enhance collapse_vars ( #2788 )
2018-01-15 18:47:23 +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
4832bc5d88
replace single-use recursive functions ( #2659 )
...
fixes #2628
2017-12-26 21:25:35 +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
8f681b1d17
handle inline of function arguments ( #2590 )
...
fixes #2476
2017-12-15 13:28:30 +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
Alex Lam S.L
9a137e8613
drop local assign-only variable in return ( #2587 )
2017-12-14 02:59:59 +08:00
Alex Lam S.L
ef618332ea
fold cascade functionality into collapse_vars ( #2586 )
2017-12-14 01:20:36 +08:00
Alex Lam S.L
7f418978c9
recover lost opportunities from #2574 ( #2584 )
2017-12-13 18:20:53 +08:00
Alex Lam S.L
04cc395c35
improve collapse_vars on side-effect-free replacements ( #2583 )
2017-12-13 04:52:54 +08:00
Alex Lam S.L
ebfd5c5c74
fix AST_VarDef.may_throw() ( #2580 )
2017-12-12 03:30:25 +08:00
Alex Lam S.L
f2ad542679
fix collapse_vars on switch ( #2578 )
2017-12-11 18:11:09 +08:00
Alex Lam S.L
0e16d92786
handle exceptional flow correctly in collapse_vars ( #2574 )
...
fixes #2571
2017-12-11 00:16:02 +08:00
Alex Lam S.L
32def5ebf5
improve synergy between collapse_vars & unused ( #2521 )
2017-11-28 14:02:39 +08:00
Alex Lam S.L
ecc9f6b770
drop assignment in AST_VarDef.value ( #2522 )
...
fixes #2516
2017-11-28 13:08:40 +08:00
Alex Lam S.L
eb001dc1d9
fix argument/atom collision by collapse_vars ( #2507 )
...
fixes #2506
2017-11-24 07:26:22 +08:00
Alex Lam S.L
8987780db6
eliminate invalid state caching in collapse_vars ( #2502 )
...
fixes #2497
2017-11-24 04:12:37 +08:00
Alex Lam S.L
49fbe9c5ac
fix replacement logic in collapse_vars ( #2475 )
2017-11-13 07:37:42 +08:00
Alex Lam S.L
c6cfa04d10
allow symbol replacement on multiple occurrences ( #2472 )
...
- all-or-nothing replacement
- avoid unmangleable names
fixes #2436
2017-11-12 22:31:47 +08:00
Alex Lam S.L
3c74047368
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
2017-11-11 05:59:35 +08:00