JS inline minor: inlined doDirectInline()
This commit is contained in:
committed by
Zalim Bashorov
parent
6018b103cc
commit
fb475775c9
@@ -84,7 +84,10 @@ class FunctionInlineMutator {
|
||||
renameLocalNames(namingContext, invokedFunction);
|
||||
|
||||
if (canBeExpression(body)) {
|
||||
doDirectInline();
|
||||
resultExpr = asExpression(body);
|
||||
body.getStatements().clear();
|
||||
/** JsExpression can be immutable, so need to reassign */
|
||||
resultExpr = (JsExpression) namingContext.applyRenameTo(resultExpr);
|
||||
} else {
|
||||
processReturns();
|
||||
namingContext.applyRenameTo(body);
|
||||
@@ -116,11 +119,6 @@ class FunctionInlineMutator {
|
||||
}
|
||||
}
|
||||
|
||||
private void doDirectInline() {
|
||||
resultExpr = asExpression(body);
|
||||
body.getStatements().clear();
|
||||
}
|
||||
|
||||
private void doReplaceReturns(int returnCount) {
|
||||
JsReturn returnOnTop = ContainerUtil.findInstance(body.getStatements(), JsReturn.class);
|
||||
boolean hasReturnOnTopLevel = returnOnTop != null;
|
||||
|
||||
Reference in New Issue
Block a user