Browse files

avoid double-parens on calls on function expressions (fixes #313)

parentheses handling in gen_code got quite messy, should be cleaned up...
  • Loading branch information...
1 parent 82a8934 commit 08a8fcb01b66325c41ba687043cf4f0feb4f3b26 @mishoo committed Feb 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/process.js
View
2 lib/process.js
@@ -1632,7 +1632,7 @@ function gen_code(ast, options) {
if (expr[0] == "num") {
if (!/\./.test(expr[1]))
out += ".";
- } else if (needs_parens(expr))
+ } else if (expr[0] != "function" && needs_parens(expr))
out = "(" + out + ")";
while (i < arguments.length)
out += "." + make_name(arguments[i++]);

0 comments on commit 08a8fcb

Please sign in to comment.