mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-08 18:46:12 +00:00
Fixed #2202 AS2 return in constructor does not take a value
This commit is contained in:
@@ -734,6 +734,24 @@ public class ActionScript2ClassDetector {
|
||||
DirectValueActionItem classBaseName = new DirectValueActionItem(classNamePath.get(classNamePath.size() - 1));
|
||||
((FunctionActionItem) constructor).calculatedFunctionName = classBaseName;
|
||||
traits.add(0, new MyEntry<>(classBaseName, constructor));
|
||||
|
||||
AbstractGraphTargetVisitor visitor = new AbstractGraphTargetVisitor() {
|
||||
@Override
|
||||
public void visit(GraphTargetItem item) {
|
||||
if (item instanceof ReturnActionItem) {
|
||||
ReturnActionItem ret = (ReturnActionItem) item;
|
||||
if (ret.value instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem dv = (DirectValueActionItem) ret.value;
|
||||
if (dv.value instanceof Undefined) {
|
||||
ret.value = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
for (GraphTargetItem ti : ((FunctionActionItem) constructor).actions) {
|
||||
ti.visitRecursively(visitor);
|
||||
}
|
||||
} else {
|
||||
//throw new AssertException("No constructor found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user