AS3 direct editation - properties resolving fix, assignment fix

This commit is contained in:
Jindra Petk
2014-04-20 15:17:18 +02:00
parent e4f275130b
commit 4f2732dcf8
2 changed files with 5 additions and 3 deletions

View File

@@ -509,8 +509,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
GraphTargetItem coerced = assignedValue;
if (!targetType.equals(srcType) && !propertyName.startsWith("@")) {
coerced = new CoerceAVM2Item(null, assignedValue, targetType);
}
}
return toSourceMerge(localData, generator, obj, coerced,
needsReturn ? dupSetTemp(localData, generator, ret_temp) : null,
ins(new SetPropertyIns(), propertyId),
@@ -568,7 +567,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
List<ABC> abcs = new ArrayList<>();
abcs.add(abc);
abcs.addAll(otherABCs);
if (cname != null && AVM2SourceGenerator.searchPrototypeChain(true, abcs, pkgName, cname, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropType, outPropValue)) {
if (cname != null && AVM2SourceGenerator.searchPrototypeChain(true, abcs, pkgName, cname, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropType, outPropValue) && (localData.currentClass.equals("".equals(outNs.getVal())?outName.getVal():outNs.getVal()+"."+outName.getVal())) ) {
NameAVM2Item nobj = new NameAVM2Item(new TypeItem(localData.currentClass), 0, "this", null, false, openedNamespaces);
nobj.setRegNumber(0);
obj = nobj;

View File

@@ -491,6 +491,9 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item {
((PropertyAVM2Item) resolved).scopeStack = scopeStack;
ret = resolved;
}
if(i == parts.size()-1){
((PropertyAVM2Item)resolved).setAssignedValue(assignedValue);
}
}
return ret;
}