JS: when both clauses of if become empty during optimization, remove if entirely. Make condition and then clause of JsIf non-nullable. Fix #KT-13912
This commit is contained in:
committed by
Alexey Andreev
parent
b5358122e2
commit
d2fdc7ffc0
@@ -630,16 +630,7 @@ public class JsAstMapper {
|
||||
|
||||
// Create the "if" statement we're mapping to.
|
||||
//
|
||||
JsIf toIf = new JsIf();
|
||||
|
||||
// Map the test expression.
|
||||
//
|
||||
JsExpression toTestExpr = mapExpression(fromTestExpr);
|
||||
toIf.setIfExpression(toTestExpr);
|
||||
|
||||
// Map the "then" block.
|
||||
//
|
||||
toIf.setThenStatement(mapStatement(fromThenBlock));
|
||||
JsIf toIf = new JsIf(mapExpression(fromTestExpr), mapStatement(fromThenBlock));
|
||||
|
||||
// Map the "else" block.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user