Only compress code in new Function if all arguments are strings.
This commit is contained in:
@@ -1590,7 +1590,7 @@ merge(Compressor.prototype, {
|
||||
right: make_node(AST_String, self, { value: "" })
|
||||
});
|
||||
case "Function":
|
||||
if (self.args[self.args.length - 1] instanceof AST_String) {
|
||||
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
|
||||
// if the code argument is a constant, then we can minify it.
|
||||
|
||||
Reference in New Issue
Block a user