JS inline: fixed bug with simple return inline function, when result is not used.

When function body can be expression
(contains only one statement, and it's return),
 result was saved to resultExpr, not body.

 But when result was not used, resultExpr was not
 used then.

 Fixed by checking, that result is used in first place.
This commit is contained in:
Alexey Tsvetkov
2014-10-13 16:45:47 +04:00
parent be82d4c661
commit 5fb5cea4a3
3 changed files with 40 additions and 1 deletions
@@ -248,6 +248,10 @@ public final class InlineTest extends SingleFileTranslationTest {
public void testIncrementProperty() throws Exception {
checkFooBoxIsOkWithInlineDirectives();
}
public void testSimpleReturnFunctionWithResultUnused() throws Exception {
checkFooBoxIsOkWithInlineDirectives();
}
private void checkFooBoxIsOkWithInlineDirectives() throws Exception {
checkFooBoxIsOk();