fix inline within arrow functions (#2881)

fixes #2874
This commit is contained in:
kzc
2018-02-05 02:01:31 -05:00
committed by Alex Lam S.L
parent 4b3c0652b7
commit 149a569ac8
3 changed files with 139 additions and 3 deletions

View File

@@ -4592,6 +4592,9 @@ merge(Compressor.prototype, {
&& !fn.uses_arguments
&& !fn.uses_eval
&& !(fn.name && fn instanceof AST_Function)
&& (!(compressor.find_parent(AST_Lambda) instanceof AST_Arrow)
|| fn.argnames.length == 0
&& (fn.body instanceof AST_Node || fn.body.length == 1))
&& (value = can_flatten_body(stat))
&& (exp === fn
|| compressor.option("unused")