diff --git a/CHANGELOG.md b/CHANGELOG.md index e059d05b1..b73421056 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - Changed /bin/bash to /usr/bin/env bash - Building does not require Naashorn - uses Beanshell instead - Use object.§§slot[index] syntax instead of /* UnknownSlot */ comment when slot cannot be determined (AS3) +- Show §§findproperty when neccessary (AS3) ### Fixed - Scaling - Distorted images/canvas on Hi-dpi monitors for Java 9 and later diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java index 3df1eedfe..3454bed79 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java @@ -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.abc.avm2.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -44,9 +45,8 @@ public class ConstructPropAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("new "); - int idx = writer.getLength(); - object.toString(writer, localData); - if (idx < writer.getLength()) { + if (!(object instanceof FindPropertyAVM2Item)) { + object.toString(writer, localData); writer.append("."); } propertyName.toString(writer, localData); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java index b2ea80c56..0561ffbae 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java @@ -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.abc.avm2.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -35,7 +36,10 @@ public class FindPropertyAVM2Item extends AVM2Item { } @Override - public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + writer.append("§§findproperty("); + propertyName.appendTo(writer, localData); + writer.append(")"); return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java index e8e670878..335bb8bea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java @@ -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.abc.avm2.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -40,9 +41,8 @@ public class GetSuperAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { - int length = writer.getLength(); - object.toString(writer, localData); - if (writer.getLength() > length) { + if (!(object instanceof FindPropertyAVM2Item)) { + object.toString(writer, localData); writer.append("."); } }