aboutsummaryrefslogtreecommitdiff
path: root/tools/eliminator
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-29 16:49:42 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-29 16:49:42 -0700
commitfd223726a4069bd0e9bbaa17d6291ad56a79cfeb (patch)
treee54ce1ea6f44f2f6491e86f367f9ff26018ded91 /tools/eliminator
parent05a26d92ef6da845cfcbff79c5fc7a2de56263bf (diff)
eliminate variables that have no uses but their definition has side effects
Diffstat (limited to 'tools/eliminator')
-rw-r--r--tools/eliminator/eliminator-test-output.js15
-rw-r--r--tools/eliminator/eliminator-test.js6
2 files changed, 16 insertions, 5 deletions
diff --git a/tools/eliminator/eliminator-test-output.js b/tools/eliminator/eliminator-test-output.js
index bff9071b..00647fca 100644
--- a/tools/eliminator/eliminator-test-output.js
+++ b/tools/eliminator/eliminator-test-output.js
@@ -105,6 +105,11 @@ function c() {
zoom(glob);
hail(w2);
sunk(y2);
+ you(fools);
+ var two = three();
+ fools(you);
+ var noneed2;
+ noneed2 += fools(you2);
return;
}
function f() {
@@ -117,7 +122,7 @@ function g(a1, a2) {
foo(c);
foo(2);
for (var i = 0; i < 5; i++) {
- var q = {
+ {
a: 1
} + [ 2, 3 ];
}
@@ -131,10 +136,10 @@ function g(a1, a2) {
} else {
__label__ = 2;
}
- var sadijn = new asd;
+ new asd;
sadijn2 = "qwe%sert";
this.Module || (this.Module = {});
- var obj = {
+ {
"quoted": 1,
"doublequoted": 2,
unquoted: 3,
@@ -3772,7 +3777,7 @@ function _malloc($bytes) {
break;
}
if ((_sbrk($839) | 0) == -1) {
- var $847 = _sbrk($825);
+ _sbrk($825);
var $tsize_0242932_ph_i = $tsize_0_i;
break $_$253;
}
@@ -5399,7 +5404,7 @@ function _mallocNoU($bytes) {
break;
}
if ((_sbrk($839) | 0) == -1) {
- var $847 = _sbrk($825);
+ _sbrk($825);
var $tsize_0242932_ph_i = $tsize_0_i;
break $_$253;
}
diff --git a/tools/eliminator/eliminator-test.js b/tools/eliminator/eliminator-test.js
index d901bc78..e44f28ad 100644
--- a/tools/eliminator/eliminator-test.js
+++ b/tools/eliminator/eliminator-test.js
@@ -129,6 +129,12 @@ function c() {
zoom(z2);
hail(w2);
sunk(y2);
+ var fly = you(fools);
+ var one, two = three(); // more than one var here, so cannot eliminate |two=|, oh well
+ var noneed;
+ noneed = fools(you);
+ var noneed2;
+ noneed2 += fools(you2);
return;
}
function f() {