[Pkg-mozext-commits] [adblock-plus] 371/464: Update to current version of the SpiderMonkey shell, adjust for the different handling of for loops and -U command line parameter being no longer necessary
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:34 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 bf285ea027ddf030e9cd9c76647452032fd3f650
Author: Wladimir Palant <trev at adblockplus.org>
Date: Wed Apr 3 13:23:21 2013 +0200
Update to current version of the SpiderMonkey shell, adjust for the different handling of for loops and -U command line parameter being no longer necessary
---
abp_rewrite.py | 2 +-
autotest.py | 2 +-
autotest/abprewrite_source.js | 4 ++--
scripts/abprewrite.js | 31 +++++++++++++++++++++++++++++++
utils.py | 2 +-
5 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/abp_rewrite.py b/abp_rewrite.py
index 71b7587..3dfc2bc 100644
--- a/abp_rewrite.py
+++ b/abp_rewrite.py
@@ -16,7 +16,7 @@ def doRewrite(files, args):
baseDir = os.path.dirname(utils.__file__)
command = [
- application, '-U', os.path.join(baseDir, 'jshydra.js'),
+ application, os.path.join(baseDir, 'jshydra.js'),
os.path.join(baseDir, 'scripts', 'abprewrite.js'),
'--arg', ' '.join(args)
] + files
diff --git a/autotest.py b/autotest.py
index 80d2cbf..6279289 100644
--- a/autotest.py
+++ b/autotest.py
@@ -34,7 +34,7 @@ def run_tests():
if arguments == None:
continue
- command = [application, '-U', os.path.join(baseDir, 'jshydra.js'), file] + arguments
+ command = [application, os.path.join(baseDir, 'jshydra.js'), file] + arguments
out = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env).communicate()[0].replace('\r', '')
expected = open(file + '.expected', 'r').read().replace('\r', '')
if out == expected:
diff --git a/autotest/abprewrite_source.js b/autotest/abprewrite_source.js
index 978926c..dec712d 100644
--- a/autotest/abprewrite_source.js
+++ b/autotest/abprewrite_source.js
@@ -47,11 +47,11 @@ else
bas();
if (a == b);
-for (var a = 0; a < b.length; a++)
+for (let a = 0; a < b.length; a++)
foo();
for (var a = 0; a < b.length; a++);
-for (var a in b)
+for (let a in b)
foo();
for (var a in b);
diff --git a/scripts/abprewrite.js b/scripts/abprewrite.js
index 9e8ba79..69dbb48 100644
--- a/scripts/abprewrite.js
+++ b/scripts/abprewrite.js
@@ -355,6 +355,37 @@ function modifyForInStatement(ast)
return ast;
}
+function modifyLetStatement(ast)
+{
+ if (ast.body.type == "ForStatement" && ast.body.init == null)
+ {
+ // Convert back "for" loops written as "let" statements:
+ // let (foo = 0) for (; foo < bar; ++foo)
+ // {
+ // ...
+ // }
+ //
+ // Change into:
+ // for (let foo = 0; foo < bar; ++foo)
+ // {
+ // ...
+ // }
+ ast.body.init = {
+ type: "VariableDeclaration",
+ declarations: [],
+ kind: "let"
+ };
+ for (let i = 0; i < ast.head.length; i++)
+ {
+ ast.head[i].type = "VariableDeclarator";
+ ast.body.init.declarations.push(ast.head[i]);
+ }
+ return modifyForStatement(ast.body);
+ }
+
+ return ast;
+}
+
function modifyFunctionExpression(ast)
{
if (ast.expression)
diff --git a/utils.py b/utils.py
index 1611d5f..2fb0ece 100644
--- a/utils.py
+++ b/utils.py
@@ -27,7 +27,7 @@ def ensureJSShell():
if sys.platform not in platform_map:
raise Exception('Unknown platform, is there a JS shell version for it?')
- download_url = 'http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/11.0-candidates/build2/jsshell-%s.zip' % platform_map[sys.platform]
+ download_url = 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/20.0-candidates/build1/jsshell-%s.zip' % platform_map[sys.platform]
data = StringIO(urllib.urlopen(download_url).read())
zip = zipfile.ZipFile(data)
zip.extractall(shell_dir)
--
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