aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/collapse_vars.js28
1 files changed, 22 insertions, 6 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index f67b3f47..39fee597 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -685,19 +685,35 @@ collapse_vars_repeated: {
var dummy = 3, a = 5, unused = 2, a = 1, a = 3;
return -a;
}
- function f2() {
- var a = 3, a = a + 2;
+ function f2(x) {
+ var a = 3, a = x;
return a;
}
+ (function(x){
+ var a = "GOOD" + x, e = "BAD", k = "!", e = a;
+ console.log(e + k);
+ })("!"),
+
+ (function(x){
+ var a = "GOOD" + x, e = "BAD" + x, k = "!", e = a;
+ console.log(e + k);
+ })("!");
}
expect: {
function f1() {
return -3
}
- function f2() {
- var a = 3, a = a + 2;
- return a
- }
+ function f2(x) {
+ return x
+ }
+ (function(x){
+ var a = "GOOD" + x, e = "BAD", e = a;
+ console.log(e + "!");
+ })("!"),
+ (function(x){
+ var a = "GOOD" + x, e = "BAD" + x, e = a;
+ console.log(e + "!");
+ })("!");
}
}