[Pkg-mozext-commits] [adblock-plus] 114/464: Fixed decompilation of |function(foo) foo| (function body is a single return statement)

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:09 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 31436c133d3b5b745262f1c773c562d93ad70130
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Thu Dec 9 17:56:51 2010 +0100

    Fixed decompilation of |function(foo) foo| (function body is a single return statement)
---
 scripts/decompile.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/decompile.js b/scripts/decompile.js
index 9e3417c..cf2d794 100644
--- a/scripts/decompile.js
+++ b/scripts/decompile.js
@@ -40,6 +40,11 @@ let visitor = {
     this._visitArray(func.arguments, '(', ') ');
     if (func.body.type == "EmptyStatement")
       output("{ }");
+    else if (func.body.type == "ReturnStatement") {
+      output("{").flush().indent();
+      func.body.visit(this);
+      unindent().output("}");
+    }
     else
       func.body.visit(this);
     return true;

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