aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compress.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index f8030722..2c950992 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1722,6 +1722,11 @@ merge(Compressor.prototype, {
}).transform(compressor);
break;
case "Function":
+ // new Function() => function(){}
+ if (self.args.length == 0) return make_node(AST_Function, self, {
+ argnames: [],
+ body: []
+ });
if (all(self.args, function(x){ return x instanceof AST_String })) {
// quite a corner-case, but we can handle it:
// https://github.com/mishoo/UglifyJS2/issues/203