diff --git a/CHANGELOG.md b/CHANGELOG.md index 278afd254..fb4501218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - [#1769], [#1888] AS3 - Missing casts like int() - [#1890] AS3 - Chained assignments in some special cases - [#1810] AS3 Direct editation - XML attribute handling +- [#1810] AS3 Direct editation - Calls inside submethods using this ## [17.0.2] - 2022-11-22 ### Fixed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index fe0131753..b44f940a7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -119,11 +119,7 @@ public class CallAVM2Item extends AVM2Item { PropertyAVM2Item prop = (PropertyAVM2Item) callable; obj = prop.object; if (obj == null) { - - /*List allAbcs = new ArrayList<>(); - allAbcs.add(g.abc); - allAbcs.addAll(g.allABCs); - */ String cname = localData.currentClass; + String cname = localData.currentClass; DottedChain pkgName = localData.pkg; Reference outName = new Reference<>(""); Reference outNs = new Reference<>(DottedChain.EMPTY); @@ -141,8 +137,7 @@ public class CallAVM2Item extends AVM2Item { otherNs.add(n.getCpoolIndex(g.abcIndex)); } } - - if (cname != null && AVM2SourceGenerator.searchPrototypeChain(null, otherNs, localData.privateNs, localData.protectedNs, true, g.abcIndex, pkgName, cname, prop.propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType) && (localData.getFullClass().equals(outNs.getVal().addWithSuffix(outName.getVal()).toRawString()))) { + if (!localData.subMethod && cname != null && AVM2SourceGenerator.searchPrototypeChain(null, otherNs, localData.privateNs, localData.protectedNs, true, g.abcIndex, pkgName, cname, prop.propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType) && (localData.getFullClass().equals(outNs.getVal().addWithSuffix(outName.getVal()).toRawString()))) { NameAVM2Item nobj = new NameAVM2Item(new TypeItem(localData.getFullClass()), 0, false, "this", "", null, false, new ArrayList<>(), abcIndex); nobj.setRegNumber(0); obj = nobj;