mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-02 03:04:19 +00:00
Fixed #2077 AS3 try..catch parts outside block
Fixed AS3 try..catch inside loop unneccessary continue
This commit is contained in:
@@ -643,6 +643,10 @@ public class Graph {
|
||||
int ret = o.level - level;
|
||||
if (ret == 0) {
|
||||
ret = part.closedTime - o.part.closedTime;
|
||||
|
||||
if (ret == 0) { //some nodes may be split in half and thus have same closedTime - like in try..catch
|
||||
return part.start - o.part.start;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -64,9 +64,7 @@ public class GraphPart implements Serializable {
|
||||
public List<GraphPart> refs = new ArrayList<>();
|
||||
|
||||
public boolean ignored = false;
|
||||
|
||||
public List<Object> forContinues = new ArrayList<>();
|
||||
|
||||
|
||||
public int level;
|
||||
|
||||
public int discoveredTime;
|
||||
|
||||
@@ -154,4 +154,14 @@ public class DoWhileItem extends LoopItem implements Block {
|
||||
public GraphTargetItem returnType() {
|
||||
return TypeItem.UNBOUNDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBaseBody() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphTargetItem> getBaseBodyCommands() {
|
||||
return commands;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,4 +171,14 @@ public class ForItem extends LoopItem implements Block {
|
||||
public GraphTargetItem returnType() {
|
||||
return TypeItem.UNBOUNDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBaseBody() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphTargetItem> getBaseBodyCommands() {
|
||||
return commands;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph.model;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.Loop;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -32,4 +33,8 @@ public abstract class LoopItem extends GraphTargetItem {
|
||||
super(src, lineStartItem, NOPRECEDENCE);
|
||||
this.loop = loop;
|
||||
}
|
||||
|
||||
public abstract boolean hasBaseBody();
|
||||
|
||||
public abstract List<GraphTargetItem> getBaseBodyCommands();
|
||||
}
|
||||
|
||||
@@ -175,4 +175,14 @@ public class SwitchItem extends LoopItem implements Block {
|
||||
public GraphTargetItem returnType() {
|
||||
return TypeItem.UNBOUNDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBaseBody() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphTargetItem> getBaseBodyCommands() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,4 +150,14 @@ public class WhileItem extends LoopItem implements Block {
|
||||
public GraphTargetItem returnType() {
|
||||
return TypeItem.UNBOUNDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBaseBody() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphTargetItem> getBaseBodyCommands() {
|
||||
return commands;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user