mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 13:00:47 +00:00
AS3:Fixed with statements
This commit is contained in:
@@ -23,6 +23,7 @@ import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.TreeItem;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.WithObjectTreeItem;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.WithTreeItem;
|
||||
import com.jpexs.asdec.abc.types.MethodBody;
|
||||
import com.jpexs.asdec.abc.types.MethodInfo;
|
||||
@@ -45,6 +46,9 @@ public class PopScopeIns extends InstructionDefinition {
|
||||
@Override
|
||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
|
||||
TreeItem scope = (TreeItem) scopeStack.pop();
|
||||
if(scope instanceof WithObjectTreeItem){
|
||||
scope = ((WithObjectTreeItem)scope).scope;
|
||||
}
|
||||
for (int i = output.size() - 1; i >= 0; i--) {
|
||||
if (output.get(i) instanceof WithTreeItem) {
|
||||
WithTreeItem wti = (WithTreeItem) output.get(i);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.TreeItem;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.WithObjectTreeItem;
|
||||
import com.jpexs.asdec.abc.avm2.treemodel.WithTreeItem;
|
||||
import com.jpexs.asdec.abc.types.MethodBody;
|
||||
import com.jpexs.asdec.abc.types.MethodInfo;
|
||||
@@ -37,7 +38,8 @@ public class PushWithIns extends InstructionDefinition {
|
||||
@Override
|
||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
|
||||
TreeItem w = (TreeItem) stack.pop();
|
||||
scopeStack.push(w);
|
||||
WithObjectTreeItem wot = new WithObjectTreeItem(ins,w);
|
||||
scopeStack.push(wot);
|
||||
output.add(new WithTreeItem(ins, w));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.asdec.abc.avm2.treemodel;
|
||||
|
||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class WithObjectTreeItem extends TreeItem {
|
||||
|
||||
public TreeItem scope;
|
||||
|
||||
public WithObjectTreeItem(AVM2Instruction instruction, TreeItem scope) {
|
||||
super(instruction, PRECEDENCE_PRIMARY);
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user