[Pkg-mozext-commits] [adblock-plus] 295/464: Hack: Force function statements to be wrapped in paretheses if called immediately

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit b86900e8dafe2504f6df2b0a697ebfb6462a9840
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Tue Aug 28 13:50:34 2012 +0200

    Hack: Force function statements to be wrapped in paretheses if called immediately
---
 scripts/astDecompile.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/astDecompile.js b/scripts/astDecompile.js
index bcf91da..e6b7d0f 100644
--- a/scripts/astDecompile.js
+++ b/scripts/astDecompile.js
@@ -204,7 +204,7 @@ function getPrecedence(expr) {
 }
 
 function decompileExpr(expr, par, forceParen) {
-  if (getPrecedence(expr) < getPrecedence(par) || (forceParen && getPrecedence(expr) == getPrecedence(par)))
+  if (getPrecedence(expr) < getPrecedence(par) || (forceParen && getPrecedence(expr) == getPrecedence(par)) || (expr.type == "FunctionExpression" && par.type == "CallExpression"))
     return "(" + decompileAST(expr) + ")";
   else
     return decompileAST(expr);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list