mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 12:50:47 +00:00
Issue #203 Improved AS1/2 compiler
AS1/2 Fixed/Added various global functions
This commit is contained in:
@@ -18,7 +18,10 @@ package com.jpexs.decompiler.flash.action.swf4;
|
||||
|
||||
import com.jpexs.decompiler.flash.action.Action;
|
||||
import com.jpexs.decompiler.flash.action.treemodel.ConstantPool;
|
||||
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
|
||||
import com.jpexs.decompiler.flash.action.treemodel.EvalTreeItem;
|
||||
import com.jpexs.decompiler.flash.action.treemodel.GetVariableTreeItem;
|
||||
import com.jpexs.decompiler.flash.action.treemodel.GetVersionTreeItem;
|
||||
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.flash.helpers.Highlighting;
|
||||
import java.util.HashMap;
|
||||
@@ -40,8 +43,14 @@ public class ActionGetVariable extends Action {
|
||||
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) {
|
||||
GraphTargetItem name = stack.pop();
|
||||
GraphTargetItem computedVal = variables.get(Highlighting.stripHilights(name.toStringNoQuotes((ConstantPool) null)));
|
||||
GetVariableTreeItem gvt = new GetVariableTreeItem(this, name);
|
||||
gvt.setComputedValue(computedVal);
|
||||
stack.push(gvt);
|
||||
if (name instanceof DirectValueTreeItem && ((DirectValueTreeItem) name).value.equals("/:$version")) {
|
||||
stack.push(new GetVersionTreeItem(this));
|
||||
} else if (!(name instanceof DirectValueTreeItem) && !(name instanceof GetVariableTreeItem)) {
|
||||
stack.push(new EvalTreeItem(this, name));
|
||||
} else {
|
||||
GetVariableTreeItem gvt = new GetVariableTreeItem(this, name);
|
||||
gvt.setComputedValue(computedVal);
|
||||
stack.push(gvt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user