paf31/purescript — pull request #134 by taku0 (2014-01-27 15:11:38+00:00)
Title: Fix inlineVariables

Probrem 1: mutable variable should not be inlined.

Input:
```Haskell
module Foo where

foo = {
var x = 0;

while (x < 10) {
x = x + 1;
}

return x;
}
```

Actual output:
```JavaScript
var Foo;
(function (Foo) {
var foo = (function () {
while (0 < 10) {
x = 0 + 1;
};
return 0;
})();
Foo.foo = foo;
})(Foo = Foo || {

});
```

Expected output:
```JavaScript
var Foo;
(function (Foo) {
var foo = (function () {
var x = 0;
while (x < 10) {
x = x + 1;
};
return x;
})();
Foo.foo = foo;
})(Foo = Foo || {

});
```

Probrem 2: Variable should not be inlined if variables in RHS are captured.

Input:
```Haskell
module Foo where

arr = [1, 2]

foo = {
var x = 0;
var y = arr !! x;
var z = (\x -> y) 1;

return x + y + z;
}
```

Actual output (note that y is inlined and x is captured):
```JavaScript
var Foo;
(function (Foo) {
var arr = [ 1, 2 ];
Foo.arr = arr;
var foo = (function () {
var x = 0;
var z = (function (x) {
return arr[x];
})(1);
return (x + arr[x]) + z;
})();
Foo.foo = foo;
})(Foo = Foo || {

});
```

Expected output:
```JavaScript
var Foo;
(function (Foo) {
var arr = [ 1, 2 ];
Foo.arr = arr;
var foo = (function () {
var x = 0;
var y = arr[x]
var z = (function (x) {
return y;
})(1);
return (x + y) + z;
})();
Foo.foo = foo;
})(Foo = Foo || {

});
```

Question:
I modified `isRebound` that is also called by `etaConvert`. Is the modification have any negative effects on `etaConvert`?