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 2026/07/10 22:49:04 UTC

(royale-compiler) 02/02: MXMLRoyaleEmitter: follow up to emitting MXML factory methods to include mx:Function, mx:Class, and mx:RegExp

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 bbe6adab4f6e3d066af33468a1dd21ea36f6ec6c
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Fri Jul 10 15:48:44 2026 -0700

    MXMLRoyaleEmitter: follow up to emitting MXML factory methods to include mx:Function, mx:Class, and mx:RegExp
    
    Followup to de684f3eb4c65bcaa424e9a5d22d45ced57c7005
---
 .../codegen/mxml/royale/MXMLRoyaleEmitter.java     | 31 +++++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
index e05f879f3..3db245f46 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
@@ -4524,10 +4524,10 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
 
             return sb.toString();
     	}
-    	else if ((instanceNode instanceof IMXMLIntNode) ||
-    			(instanceNode instanceof IMXMLUintNode) ||
-    			(instanceNode instanceof IMXMLNumberNode) ||
-    			(instanceNode instanceof IMXMLBooleanNode))
+    	else if (instanceNode instanceof IMXMLIntNode ||
+    			instanceNode instanceof IMXMLUintNode ||
+    			instanceNode instanceof IMXMLNumberNode ||
+    			instanceNode instanceof IMXMLBooleanNode)
     	{
     		IMXMLExpressionNode scalarNode = (IMXMLExpressionNode)instanceNode;
     		IASNode vNode = scalarNode.getExpressionNode();
@@ -4538,6 +4538,29 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
 	            return value.toString();
     		}
     	}
+        else if (instanceNode instanceof IMXMLRegExpNode)
+        {
+    		IMXMLRegExpNode regExpNode = (IMXMLRegExpNode)instanceNode;
+    		IASNode vNode = regExpNode.getExpressionNode();
+    		if (vNode instanceof IRegExpLiteralNode)
+    		{
+                IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                        .getASEmitter();
+                return ((JSRoyaleEmitter)asEmitter).stringifyNode(vNode);
+    		}
+        }
+        else if (instanceNode instanceof IMXMLFunctionNode ||
+                instanceNode instanceof IMXMLClassNode)
+        {
+            IMXMLExpressionNode mxmlExprNode = (IMXMLExpressionNode) instanceNode;
+            IASNode exprNode = mxmlExprNode.getExpressionNode();
+            if (exprNode instanceof IIdentifierNode || exprNode instanceof IMemberAccessExpressionNode)
+            {
+                IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                        .getASEmitter();
+                return ((JSRoyaleEmitter)asEmitter).stringifyNode(exprNode);
+            }
+        }
     	return "";
     }