Merge pull request #570 from rvanvelzen/fix-569

Fix #569
This commit is contained in:
Richard van Velzen
2015-01-04 14:02:08 +01:00

View File

@@ -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