Show §§findproperty when neccessary (AS3)

This commit is contained in:
Jindra Petřík
2021-01-09 08:43:45 +01:00
parent 637f52091a
commit 4926cb04d0
4 changed files with 15 additions and 10 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.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 ");
writer.append("new ");
int idx = writer.getLength();
object.toString(writer, localData);
if (!(object instanceof FindPropertyAVM2Item)) {
object.toString(writer, localData);
writer.append(".");
}
propertyName.toString(writer, localData);

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.abc.avm2.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -35,7 +36,10 @@ public class FindPropertyAVM2Item extends AVM2Item {
}
@Override
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
writer.append("§§findproperty(");
propertyName.appendTo(writer, localData);
writer.append(")");
return writer;
}

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.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")) {
if (!object.toString().equals("this")) {
int length = writer.getLength();
object.toString(writer, localData);
if (!(object instanceof FindPropertyAVM2Item)) {
object.toString(writer, localData);
writer.append(".");
}
}