From 4f2732dcf80958ced0ec5298f41dae058bd334c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 20 Apr 2014 15:17:18 +0200 Subject: [PATCH] AS3 direct editation - properties resolving fix, assignment fix --- .../flash/abc/avm2/parser/script/PropertyAVM2Item.java | 5 ++--- .../flash/abc/avm2/parser/script/UnresolvedAVM2Item.java | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 539af5799..7ec4cb2b7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -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 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; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 71648451c..d5d2fb8df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -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; }