Skip to content

Commit

Permalink
avoid moving any named lambda into an export. Closes #800
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Oct 11, 2020
1 parent ece460d commit 4baf764
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/compress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6367,7 +6367,9 @@ def_optimize(AST_SymbolRef, function(self, compressor) {
&& !(parent instanceof AST_Call
&& (parent.is_expr_pure(compressor))
|| has_annotation(parent, _NOINLINE))
&& !(fixed instanceof AST_Defun && parent instanceof AST_Export);
&& !(parent instanceof AST_Export
&& fixed instanceof AST_Lambda
&& fixed.name);

if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) {
if (retain_top_func(fixed, compressor)) {
Expand Down

0 comments on commit 4baf764

Please sign in to comment.