AS3 direct editing - submethod name resolving fix

This commit is contained in:
Jindra Petřík
2014-09-23 21:11:10 +02:00
parent b211d3b8cf
commit d89e02426e
3 changed files with 5 additions and 2 deletions

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash;
import com.jpexs.decompiler.flash.abc.types.ABCException;
@@ -49,6 +50,7 @@ public class SourceGeneratorLocalData implements Serializable {
public List<GraphTargetItem> scopeStack = new ArrayList<>();
public boolean documentClass;
public ScriptInfo currentScript;
public boolean subMethod = false;
public String getFullClass() {
return pkg == null || pkg.isEmpty() ? currentClass : pkg + "." + currentClass;

View File

@@ -1386,6 +1386,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
newlocalData.traitUsages = localData.traitUsages;
newlocalData.currentScript = localData.currentScript;
newlocalData.documentClass = localData.documentClass;
newlocalData.subMethod = subMethod;
localData = newlocalData;
localData.activationReg = 0;

View File

@@ -630,7 +630,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
List<ABC> abcs = new ArrayList<>();
abcs.add(abc);
abcs.addAll(otherABCs);
if (cname != null && AVM2SourceGenerator.searchPrototypeChain(true, abcs, pkgName, cname, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue) && (localData.currentClass.equals("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal()))) {
if (!localData.subMethod && cname != null && AVM2SourceGenerator.searchPrototypeChain(true, abcs, pkgName, cname, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue) && (localData.currentClass.equals("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal()))) {
NameAVM2Item nobj = new NameAVM2Item(new TypeItem(localData.getFullClass()), 0, "this", null, false, openedNamespaces);
nobj.setRegNumber(0);
obj = nobj;