[Pkg-javascript-commits] [uglifyjs] 08/77: Fix #569
Jonas Smedegaard
dr at jones.dk
Tue May 19 00:02:27 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag v2.4.18
in repository uglifyjs.
commit f4d36a58c28cd6dd598a5e92c6ab56605b8c17e4
Author: Richard van Velzen <rvanvelzen1 at gmail.com>
Date: Thu Oct 23 15:57:12 2014 +0200
Fix #569
When no arguments are given to `new Function()`, it should be treated as
a regular anonymous function (http://es5.github.io/#x15.3.2.1)
---
lib/compress.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/compress.js b/lib/compress.js
index f803072..2c95099 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list