alexlamsl
f9e9898dc1
Merge branch 'master' into harmony-v3.3.7
2018-01-14 17:15:16 +08:00
Alex Lam S.L
8c763bf2b5
fix mangle of block-scoped variables ( #2779 )
...
fixes #2762
2018-01-14 12:12:29 +08:00
kzc
2cab348341
improve SymbolDef info in --output ast ( #2778 )
...
* SymbolDef info (a.k.a. `thedef`) is now represented as a string containing `"ID name [mangled_name]"`.
* Enhance display of `globals`, `variables`, `functions` and `enclosed`.
* `SymbolDef.next_id` starts at `1` and the `id` is adjusted for `-o ast` display.
2018-01-14 01:40:51 +08:00
alexlamsl
0f2be1456c
Merge branch 'master' into harmony-v3.3.6
2018-01-13 13:53:31 +08:00
kzc
d4d7d99b70
add SymbolDef IDs to --output ast ( #2772 )
2018-01-12 15:41:09 +08:00
Alex Lam S.L
1eb15f46f1
fix reduce_vars with uninitialized let variables ( #2760 )
...
fixes #2757
2018-01-10 18:40:54 +08:00
Alex Lam S.L
bf832cde16
improve synergy between compress and rename ( #2755 )
2018-01-09 17:55:41 +08:00
alexlamsl
7a8eff62ca
Merge branch 'master' into harmony-v3.3.5
2018-01-07 20:35: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
afbcebddf6
fix mangle name collision across files ( #2722 )
2018-01-05 05:08:09 +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
ffc64e2279
mark AST_Var out of block scopes ( #2700 )
2018-01-02 01:37:59 +08:00
Alex Lam S.L
4832bc5d88
replace single-use recursive functions ( #2659 )
...
fixes #2628
2017-12-26 21:25:35 +08:00
alexlamsl
c9dbe9deb1
Merge branch 'master' into harmony-v3.2.1
2017-12-03 11:59:41 +08:00
Alex Lam S.L
172079a47f
improve code reuse ( #2542 )
2017-12-01 03:40:46 +08:00
Alex Lam S.L
62d2817d6c
reduce this in block scopes ( #2526 )
...
fixes #2455
2017-11-28 22:54:21 +08:00
alexlamsl
4f08c2f504
Merge branch 'master' into harmony-v3.2.0
2017-11-26 04:23:57 +08:00
Alex Lam S.L
30cfea2e7a
fix rename ( #2501 )
...
- suppress spurious `rename` from `commander`
- handle `AST_SymbolCatch` correctly
2017-11-24 03:05:43 +08:00
Alex Lam S.L
f4e2fb9864
expand symbol space to improve compression ( #2460 )
...
- give globally distinct names to distinct variables
- improve ability to compress cross-scoped
- introduce `options.rename` to `minify()`
- default `true` if both `compress` & `mangle`
2017-11-19 19:29:51 +08:00
alexlamsl
227b58812d
Merge branch 'master' into harmony-v3.1.10
2017-11-19 14:34:27 +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
GUENEGO Jean-Louis
1241600013
mangle: do not mangle reserved class ( #2317 )
...
fixes #2316
2017-09-24 00:08:47 +08:00
alexlamsl
e0e009ace2
Merge branch 'master' into harmony-v3.0.28
2017-08-20 00:35:46 +08:00
Alex Lam S.L
a5461e0adc
prohibit let/const redeclaration ( #2277 )
...
fixes #2270
2017-08-14 12:31:12 +08:00
Alex Lam S.L
e7c21e87e3
fix ie8 mangling of top-level AST_SymbolCatch ( #2263 )
...
fixes #2254
2017-08-01 02:38:32 +08:00
Alex Lam S.L
d3df2f985d
extend collapse_vars to let and const ( #2252 )
...
fixes #2250
2017-07-25 22:07:21 +08:00
alexlamsl
3a2b737c42
Merge branch 'master' into harmony-v3.0.25
2017-07-16 11:15:07 +08:00
Alex Lam S.L
a5ffe2c23f
drop unused builtin globals under unsafe ( #2236 )
...
fixes #2233
2017-07-15 15:16:11 +08:00
alexlamsl
11afa816e3
Merge branch 'master' into harmony-v3.0.20
2017-06-25 16:43:44 +08:00
Alex Lam S.L
94e5e00c03
refactor compute_char_frequency() ( #2152 )
...
- minimise maintenance when updating AST
- maximise code sharing between `master` & `harmony`
2017-06-23 20:05:31 +08:00
Alex Lam S.L
137e4c4753
fix unused on AST_Destructuring ( #2146 )
2017-06-23 13:11:26 +08:00
Alex Lam S.L
b163b13a0b
fix export of keyword and redirection ( #2143 )
...
fixes #2141
fixes #2142
2017-06-23 03:49:30 +08:00
alexlamsl
f5931866e0
Merge branch 'master' into harmony-v3.0.19
2017-06-22 03:26:49 +08:00
Alex Lam S.L
8709753bfb
fix mangle on export ( #2133 )
...
- `export default ...`
- `export` with `AST_Destructuring`
fixes #2129
2017-06-21 14:22:09 +08:00
Alex Lam S.L
11923e3ae8
reject non-toplevel import/export ( #2128 )
...
fixes #2124
2017-06-21 03:18:48 +08:00
Alex Lam S.L
343ea326c2
ensure mangling works if catch reuses a scope variable ( #2123 )
...
fixes #2120
2017-06-20 02:14:05 +08:00
alexlamsl
78cf35f89c
Merge branch 'master' into harmony-v3.0.17
2017-06-15 19:01:36 +08:00
kzc
100e18305d
first cut of async/await ( #2098 )
...
- async arrow functions not yet supported
fixes #1789
2017-06-15 06:15:48 +08:00
Alex Lam S.L
3f961bbba0
compute uses_arguments correctly in figure_out_scope() ( #2099 )
...
fixes #2097
2017-06-15 03:28:26 +08:00
alexlamsl
8af362ed57
Merge branch 'master' into harmony-v3.0.16
2017-06-14 17:09:30 +08:00
Alex Lam S.L
293c566d6c
marshal mangle[.properties].reserved from non-Array values ( #2072 )
2017-06-09 04:29:12 +08:00
Alex Lam S.L
23265ac253
mangle destructuring function parameters ( #2029 )
...
fixes #2025
2017-05-30 23:41:55 +08:00
alexlamsl
aa835eb0f6
Merge branch 'master' into harmony-v3.0.12
2017-05-27 18:12:10 +08:00
Alex Lam S.L
39d4d7e20a
fix export related issues ( #2005 )
...
- `mangle` non-exported names
- `unused` on `export` of `function`
- `hoist_funs` on `export`
- `export default`
- prohibit definition statements
- parse `AST_Defun` properly
- drop only unused class and function names
fixes #2001
fixes #2004
2017-05-26 13:35:40 +08:00
Alex Lam S.L
c70fb60384
clean up lib/scope.js ( #2003 )
...
fixes #2004
2017-05-26 03:58:35 +08:00
kzc
7bcb442e4c
fix destructuring bugs in mangle and compress ( #1992 )
...
- destructuring mangle
- destructuring array default values
fixes #1335
2017-05-23 02:53:01 +08:00
alexlamsl
81243c4e71
Merge branch 'master' into harmony-v3.0.5
2017-05-15 18:58:54 +08:00
alexlamsl
cd6e849555
Revert "remove support for const ( #1910 )"
...
This reverts commit c391576d52 .
2017-05-15 18:38:16 +08:00
Alex Lam S.L
3ca902258c
fix bugs with getter/setter ( #1926 )
...
- `reduce_vars`
- `side_effects`
- property access for object
- `AST_SymbolAccessor` as key names
enhance `test/ufuzz.js`
- add object getter & setter
- property assignment to setter
- avoid infinite recursion in setter
- fix & adjust assignment operators
- 50% `=`
- 25% `+=`
- 2.5% each for the rest
- avoid "Invalid array length"
- fix `console.log()`
- bypass getter
- curb recursive reference
- deprecate `-E`, always report runtime errors
2017-05-14 02:10:34 +08:00