Fixed #2111 AS3 direct editation - access class in class initializer

This commit is contained in:
Jindra Petřík
2023-11-13 22:01:04 +01:00
parent 9bfb8b117d
commit 237b9ba1dc
2 changed files with 5 additions and 1 deletions

View File

@@ -2909,7 +2909,9 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
}
}
if (globalSlotId > 0) {
if (localData.isStatic && item.toString().equals(currentFullClassName)) {
return Arrays.asList(ins(AVM2Instructions.GetLocal0));
} else if (globalSlotId > 0) {
return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetGlobalScope), ins(AVM2Instructions.GetSlot, globalSlotId));
} else {
return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetLex, resolveType(localData, item, abcIndex)));