Fix tests

This commit is contained in:
Jindra Petřík
2024-09-24 23:37:16 +02:00
parent 042fa4e441
commit 7172ac5152
3 changed files with 10 additions and 3 deletions

View File

@@ -2707,9 +2707,9 @@ public class AVM2Graph extends Graph {
boolean move = true;
if (parent instanceof SetTypeAVM2Item) {
SetTypeAVM2Item setType = (SetTypeAVM2Item) parent;
if (setType.getValue() == item) { //chained assignment
if (setType.getValue().getNotCoerced() == item || setType.getObject() == item) { //chained assignment
move = false;
}
}
}
if (move) {
foundSetLoc.setVal((SetLocalAVM2Item) item);

View File

@@ -125,7 +125,14 @@ public abstract class AVM2Item extends GraphTargetItem {
//but removing this fails testNames test
FindPropertyAVM2Item fp = (FindPropertyAVM2Item) object.getThroughDuplicate();
if (fp.propertyName instanceof FullMultinameAVM2Item) {
if (propertyName instanceof FullMultinameAVM2Item) {
if (!((FullMultinameAVM2Item) propertyName).property) {
((FullMultinameAVM2Item) fp.propertyName).property = false; // for constructprop
}
}
propertyName = fp.propertyName;
}
}

View File

@@ -86,7 +86,7 @@ public class ConstructPropAVM2Item extends AVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
writer.append("new ");
formatProperty(writer, object, propertyName, localData, isStatic);
formatProperty(writer, object, propertyName, localData, isStatic);
writer.spaceBeforeCallParenthesies(args.size());
writer.append("(");
for (int a = 0; a < args.size(); a++) {