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
The following commit(s) were added to refs/heads/develop by this push:
new ce9a41b0a MXMLClassDirectiveProcessor, MXMLClassReferenceNodeBase: fix
operand stack underflow when using <mx:Repeater>
ce9a41b0a is described below
commit ce9a41b0a5055e8d1252c09487d7bb00d6de2642
Author: Josh Tynjala <[email protected]>
AuthorDate: Fri Jul 10 14:22:25 2026 -0700
MXMLClassDirectiveProcessor, MXMLClassReferenceNodeBase: fix operand stack
underflow when using <mx:Repeater>
---
RELEASE_NOTES.md | 3 ++-
.../internal/as/codegen/MXMLClassDirectiveProcessor.java | 3 ++-
.../internal/tree/mxml/MXMLClassReferenceNodeBase.java | 13 +++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index c91821504..3dce01be2 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -67,7 +67,8 @@ Apache Royale Compiler 1.0.0
- compiler: Fixed invalid MXML children sometimes getting ignored completely.
Now reports an appropriate error.
- compiler: Fixed MXML `<fx:Vector>` not being emitted to JavaScript.
- compiler: Fixed property assignment in MXML factory methods when using data
binding.
-- compiler: Fixed `<fx:DesignLayer>` allowing children without
`[DefaultProperty]` metadata.
+- compiler: Fixed `<fx:DesignLayer>` should allow children without
`[DefaultProperty]` metadata.
+- compiler: Fixed `<fx:Repeater>` should allow children without
`[DefaultProperty]` metadata.
- compiler: Added `${mainClass}` token to HTML template replacement.
- compiler: Fixed resolution of `[InstanceType]` classes when they are in a
package.
- compiler: JS target doesn't call `start()` for MXML classes, similar to AS3
classes.
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
index 2cb350516..5bd0fb018 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
@@ -2404,8 +2404,9 @@ public class MXMLClassDirectiveProcessor extends
ClassDirectiveProcessor
final boolean isInstanceNode = node instanceof IMXMLInstanceNode;
final boolean isResourceNode = node instanceof IMXMLResourceNode;
final boolean isDesignLayerNode = node instanceof IMXMLDesignLayerNode;
+ final boolean isRepeaterNode = node instanceof IMXMLRepeaterNode;
final boolean isDataBindingNode = isDataBindingNode(node);
- return isInstanceNode && !isDesignLayerNode && !(isDataBindingNode ||
isResourceNode);
+ return isInstanceNode && !isDesignLayerNode && !isRepeaterNode &&
!(isDataBindingNode || isResourceNode);
}
/**
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
index e931018dd..654b52616 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
@@ -122,6 +122,12 @@ abstract class MXMLClassReferenceNodeBase extends
MXMLNodeBase implements IMXMLC
*/
private boolean isDesignLayer = false;
+ /**
+ * A flag that keeps track of whether the node represents a repeater
+ * (i.e., an mx.core.Repe).
+ */
+ private boolean isRepeater = false;
+
private String containerInterface;
private String uiComponentInterface;
@@ -279,6 +285,11 @@ abstract class MXMLClassReferenceNodeBase extends
MXMLNodeBase implements IMXMLC
return isDesignLayer;
}
+ private boolean isRepeater()
+ {
+ return isRepeater;
+ }
+
/**
* Sets the definition of the ActionScript class to which this node refers.
*/
@@ -306,6 +317,7 @@ abstract class MXMLClassReferenceNodeBase extends
MXMLNodeBase implements IMXMLC
uiComponentInterface = project.getUIComponentInterface();
isDesignLayer =
classReference.isInstanceOf(IMXMLTypeConstants.DesignLayer, project);
+ isRepeater = classReference.isInstanceOf(IMXMLTypeConstants.Repeater,
project);
// Keep track of whether the class implements
mx.core.IDeferredInstantiationUIComponent
// because that affects code generation.
@@ -548,6 +560,7 @@ abstract class MXMLClassReferenceNodeBase extends
MXMLNodeBase implements IMXMLC
else
{
if (isDesignLayer()
+ || (isRepeater() &&
classDefinition.isInstanceOf(uiComponentInterface, builder.getProject()))
|| (isContainer() &&
classDefinition.isInstanceOf(uiComponentInterface, builder.getProject())))
{
// This tag is not part of the default property
value.