Issue #89 AS3: bracket in property name lead to missing dot

This commit is contained in:
Jindra Petk
2013-05-05 18:27:55 +02:00
parent c447f3b721
commit 8cb318dfcb

View File

@@ -86,26 +86,16 @@ public abstract class TreeItem extends GraphTargetItem {
return propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames));
}
if (propertyName instanceof FullMultinameTreeItem) {
if (((FullMultinameTreeItem) propertyName).isRuntime()) {
return joinProperty(obStr, propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)));
if (((FullMultinameTreeItem) propertyName).name != null) {
return obStr + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames));
} else {
return joinProperty(obStr, ((FullMultinameTreeItem) propertyName).toString(constants, localRegNames, fullyQualifiedNames));
return obStr + "." + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames));
}
} else {
return obStr + "[" + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "]";
}
}
private String joinProperty(String prefix, String name) {
if (prefix.endsWith(".")) {
prefix = prefix.substring(0, prefix.length() - 1);
}
if (!Highlighting.stripHilights(name).startsWith("[")) {
return prefix + "." + name;
}
return prefix + name;
}
public static String localRegName(HashMap<Integer, String> localRegNames, int reg) {
if (localRegNames.containsKey(reg)) {
return localRegNames.get(reg);