Fixed AS1/2 - direct editation - do..while

This commit is contained in:
Jindra Petřík
2021-11-28 18:18:46 +01:00
parent 15313d4c13
commit 3033f1f39f
2 changed files with 9 additions and 1 deletions

View File

@@ -256,7 +256,14 @@ public class ActionSourceGenerator implements SourceGenerator {
@Override
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, DoWhileItem item) throws CompilationException {
List<GraphSourceItem> ret = new ArrayList<>();
List<Action> doExpr = generateToActionList(localData, item.expression);
List<Action> doExpr = new ArrayList<>();
List<GraphTargetItem> ex = new ArrayList<>(item.expression);
if (!ex.isEmpty()) {
GraphTargetItem lastItem = ex.remove(ex.size() - 1);
doExpr.addAll(generateToActionList(localData, ex));
doExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result
}
List<Action> doBody = generateToActionList(localData, item.commands);
int doBodyLen = Action.actionsToBytes(doBody, false, SWF.DEFAULT_VERSION).length;