[Pkg-mozext-commits] [adblock-plus] 432/464: Issue 516 - JSHydra: return {foo:bar} produces broken code
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:41 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 7ed697f09a1e5bdaedf5dab2f4e9b09adbd93907
Author: Wladimir Palant <trev at adblockplus.org>
Date: Mon May 19 08:58:28 2014 +0200
Issue 516 - JSHydra: return {foo:bar} produces broken code
---
autotest/abprewrite_source.js | 5 +++++
autotest/test_abprewrite.js.expected | 23 +++++++++++++++++------
autotest/test_abprewrite_module.js.expected | 23 +++++++++++++++++------
scripts/abprewrite.js | 2 +-
4 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/autotest/abprewrite_source.js b/autotest/abprewrite_source.js
index 14bb25d..e371291 100644
--- a/autotest/abprewrite_source.js
+++ b/autotest/abprewrite_source.js
@@ -41,6 +41,11 @@ let b = {
get foo() 1
};
+function foo()
+{
+ return {foo: 1, bar: 2};
+}
+
if (a == b)
foo();
else if (a == c)
diff --git a/autotest/test_abprewrite.js.expected b/autotest/test_abprewrite.js.expected
index 3b7f582..49d5e12 100644
--- a/autotest/test_abprewrite.js.expected
+++ b/autotest/test_abprewrite.js.expected
@@ -66,13 +66,20 @@ var a = function()
{
return 1;
};
-var b =
-{
+var b = {
get foo()
{
return 1;
}
};
+
+function foo()
+{
+ return {
+ foo: 1,
+ bar: 2
+ };
+}
if (a == b)
{
foo();
@@ -85,22 +92,26 @@ else
{
bas();
}
-if (a == b){}
+if (a == b)
+{}
for (var a = 0; a < b.length; a++)
{
foo();
}
-for (var a = 0; a < b.length; a++){}
+for (var a = 0; a < b.length; a++)
+{}
for (var a in b)
{
foo();
}
-for (var a in b){}
+for (var a in b)
+{}
while (a == b)
{
foo();
}
-while (a == b){}
+while (a == b)
+{}
function genFunc()
{
diff --git a/autotest/test_abprewrite_module.js.expected b/autotest/test_abprewrite_module.js.expected
index 8debcdd..5d23db2 100644
--- a/autotest/test_abprewrite_module.js.expected
+++ b/autotest/test_abprewrite_module.js.expected
@@ -69,13 +69,20 @@ require.scopes["abprewrite_source"] = (function()
{
return 1;
};
- var b =
- {
+ var b = {
get foo()
{
return 1;
}
};
+
+ function foo()
+ {
+ return {
+ foo: 1,
+ bar: 2
+ };
+ }
if (a == b)
{
foo();
@@ -88,22 +95,26 @@ require.scopes["abprewrite_source"] = (function()
{
bas();
}
- if (a == b){}
+ if (a == b)
+ {}
for (var a = 0; a < b.length; a++)
{
foo();
}
- for (var a = 0; a < b.length; a++){}
+ for (var a = 0; a < b.length; a++)
+ {}
for (var a in b)
{
foo();
}
- for (var a in b){}
+ for (var a in b)
+ {}
while (a == b)
{
foo();
}
- while (a == b){}
+ while (a == b)
+ {}
function genFunc()
{
diff --git a/scripts/abprewrite.js b/scripts/abprewrite.js
index 8ca06ba..3b66b1b 100644
--- a/scripts/abprewrite.js
+++ b/scripts/abprewrite.js
@@ -15,7 +15,7 @@ let options = {
varIndex: 0,
indent_size: 2,
preserve_newlines: false,
- brace_style: "expand-strict",
+ brace_style: "expand",
source_repo: ""
};
let global = this;
--
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