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:45:59 UTC

[royale-compiler] branch develop updated (053ea997f -> 1c3acfe97)

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


    from 053ea997f MXMLRoyaleEmitter: remove dead code that was causing a null exception (closes #216)
     new e570d87f6 MXMLDataBindingParser: fix data binding being incorrectly detected inside CData text (references #213)
     new 1c3acfe97 MXMLDataBindingParser: use constant instead of literal

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../compiler/internal/tree/mxml/MXMLDataBindingParser.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)


[royale-compiler] 01/02: MXMLDataBindingParser: fix data binding being incorrectly detected inside CData text (references #213)

Posted by jo...@apache.org.
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++)
             {


[royale-compiler] 02/02: MXMLDataBindingParser: use constant instead of literal

Posted by jo...@apache.org.
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 1c3acfe9767359e35fd6fe0607d22be0946243db
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Dec 7 12:39:55 2022 -0800

    MXMLDataBindingParser: use constant instead of literal
---
 .../royale/compiler/internal/tree/mxml/MXMLDataBindingParser.java      | 3 ++-
 1 file changed, 2 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 ccd9fc72c..329ba167d 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
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.royale.compiler.common.ISourceLocation;
+import org.apache.royale.compiler.constants.IMXMLCoreConstants;
 import org.apache.royale.compiler.internal.mxml.MXMLDialect;
 import org.apache.royale.compiler.internal.parsing.ISourceFragment;
 import org.apache.royale.compiler.internal.parsing.SourceFragment;
@@ -154,7 +155,7 @@ class MXMLDataBindingParser
         {
             String physicalText = fragment.getPhysicalText();
             String text = fragment.getLogicalText();
-            if (physicalText.startsWith("<![CDATA[") && !text.startsWith("<![CDATA["))
+            if (physicalText.startsWith(IMXMLCoreConstants.cDataStart) && !text.startsWith(IMXMLCoreConstants.cDataStart))
             {
                 // CData cannot contain data binding
                 continue;