Fixed AS3 Simplify expressions - Do not convert this to {} when coerced

This commit is contained in:
Jindra Petřík
2023-10-06 17:42:14 +02:00
parent 2644575a20
commit ca0dc86cf3
4 changed files with 12 additions and 3 deletions

View File

@@ -127,7 +127,15 @@ public class CoerceAVM2Item extends AVM2Item {
return false;
}
dependencies.add(value);
return value.isConvertedCompileTime(dependencies);
switch(typeObj.toString()) {
case "String":
case "Boolean":
case "int":
case "uint":
case "Number":
return value.isConvertedCompileTime(dependencies);
}
return false;
}
@Override

View File

@@ -31,7 +31,7 @@ public class ObjectType implements Callable {
public static final ObjectType EMPTY_OBJECT = new ObjectType();
protected Map<String, Object> attributes;
public void setAttribute(String name, Object value) {
attributes.put(name, value);
}

View File

@@ -180,7 +180,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
case "Boolean":
r = EcmaScript.toBoolean(r);
break;
}
}
GraphTargetItem it2 = valToItem(r);
if (it2 == null) {