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 2022/12/07 20:46:00 UTC
[royale-compiler] 01/02: MXMLDataBindingParser: fix data binding being incorrectly detected inside CData text (references #213)
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 e570d87f621837b2dc9e6eafa4de9a79f89600fb
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Dec 7 10:00:22 2022 -0800
MXMLDataBindingParser: fix data binding being incorrectly detected inside CData text (references #213)
---
.../royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java
index d25b81456..ccd9fc72c 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java
@@ -152,8 +152,14 @@ class MXMLDataBindingParser
// Iterate over each input fragment.
for (ISourceFragment fragment : fragments)
{
- // Iterate over each character of logical text in the current fragment.
+ String physicalText = fragment.getPhysicalText();
String text = fragment.getLogicalText();
+ if (physicalText.startsWith("<![CDATA[") && !text.startsWith("<![CDATA["))
+ {
+ // CData cannot contain data binding
+ continue;
+ }
+ // Iterate over each character of logical text in the current fragment.
int n = text.length();
for (int i = 0; i < n; i++)
{