You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/05/25 21:10:29 UTC
[royale-compiler] 02/02: BindingInfo: fix issue where binding to
MXML did not work
This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 756e1f46adf216f63cb4870f75bc781066c8a3e9
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue May 25 13:55:33 2021 -0700
BindingInfo: fix issue where binding to MXML <fx:Array> did not work
This change makes the Royale compiler match the behavior of the Flex SDK compiler
---
.../royale/compiler/internal/codegen/databinding/BindingInfo.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingInfo.java b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingInfo.java
index 30c3c8d..d312941 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingInfo.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingInfo.java
@@ -48,6 +48,7 @@ import org.apache.royale.compiler.tree.as.IExpressionNode;
import org.apache.royale.compiler.tree.as.IFunctionCallNode;
import org.apache.royale.compiler.tree.as.IIdentifierNode;
import org.apache.royale.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.royale.compiler.tree.mxml.IMXMLArrayNode;
import org.apache.royale.compiler.tree.mxml.IMXMLBindingAttributeNode;
import org.apache.royale.compiler.tree.mxml.IMXMLBindingNode;
import org.apache.royale.compiler.tree.mxml.IMXMLClassDefinitionNode;
@@ -304,6 +305,13 @@ public class BindingInfo implements Comparable<BindingInfo>
assert id != null;
destString = id;
}
+ else if (parent instanceof IMXMLArrayNode)
+ {
+ // We are an MXML primitive, so the dest string is just our ID
+ String id = ((IMXMLArrayNode)parent).getEffectiveID();
+ assert id != null;
+ destString = id;
+ }
else if (parent instanceof IMXMLModelPropertyNode)
{
// For now, we are always making a destination function, so we