JS: fix bug in temporary variable eliminator

The problem was in considering `a` as trivial in following case:

```
var a = b;
```

However, that's wrong assumption, since `b` can be temporary variable
itself which is further substituted by a non-trivial expression.
This commit is contained in:
Alexey Andreev
2017-08-24 16:18:55 +03:00
parent abb254297a
commit 989cebe79e
3 changed files with 38 additions and 1 deletions
@@ -4484,6 +4484,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
doTest(fileName);
}
@TestMetadata("temporaryVarNonTrivial.kt")
public void testTemporaryVarNonTrivial() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/temporaryVarNonTrivial.kt");
doTest(fileName);
}
@TestMetadata("ternaryConditional.kt")
public void testTernaryConditional() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/inlineEvaluationOrder/ternaryConditional.kt");