[Pkg-mozext-commits] [adblock-plus] 41/87: Issue 3822 - Fix strict-mode in generated modules

David Prévot taffit at moszumanska.debian.org
Sat Apr 30 17:59:06 UTC 2016


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

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

commit e985b0db31bd7dcc3082d720ed3078a5cbbfccf5
Author: Sebastian Noack <sebastian at adblockplus.org>
Date:   Thu Mar 17 14:42:43 2016 +0100

    Issue 3822 - Fix strict-mode in generated modules
---
 scripts/abprewrite.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/abprewrite.js b/scripts/abprewrite.js
index d484e3c..f4f45a1 100644
--- a/scripts/abprewrite.js
+++ b/scripts/abprewrite.js
@@ -558,8 +558,8 @@ process_js = function(ast, filename, args)
     //   return exports;
     // })();
     let code = 'require.scopes["' + options.filename + '"] = (function() {\n' +
-               'var exports = {};\n' +
-               decompileAST(ast) +
+               decompileAST(ast).replace(/^("use strict";\n)?/,
+                                         "$1var exports = {};\n") +
                'return exports;\n' +
                '})();\n';
     _print(js_beautify(code, options));

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