flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/2] git commit: [flex-falcon] [refs/heads/develop] - FLEX-35141 fix XML literal handling'
Date Thu, 13 Oct 2016 16:06:08 GMT
FLEX-35141 fix XML literal handling'


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/38ca9c95
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/38ca9c95
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/38ca9c95

Branch: refs/heads/develop
Commit: 38ca9c957e01df7de9eba07b33eb3a62b6da7877
Parents: bb4cbcf
Author: Alex Harui <aharui@apache.org>
Authored: Thu Oct 13 09:05:37 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Oct 13 09:05:37 2016 -0700

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/jx/LiteralEmitter.java     | 2 +-
 .../internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/38ca9c95/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
index 1be3b1e..d3fc55d 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
@@ -91,7 +91,7 @@ public class LiteralEmitter extends JSSubEmitter implements
             				else
             					sb.append(s);
             			}
-        				inAttribute = s.equals("=");
+        				inAttribute = s.endsWith("=");
             		}
             		s = sb.toString();
             	}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/38ca9c95/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
index 291368d..2527073 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
@@ -355,6 +355,15 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
     }
     
     @Test
+    public void testXMLLiteralWithTemplateAndParams()
+    {
+        VariableNode node = (VariableNode)getNode("private function test(attributevalue:String)
{ var a:XML = <name attributeName={attributevalue} />;}",
+        							 VariableNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = new XML( '<name attributeName=' + '\"' +
attributevalue + '\"' + ' />')");
+    }
+    
+    @Test
     public void testXMLLiteralWithTemplateExpression()
     {
         VariableNode node = (VariableNode)getNode("private function get tagname():String
{ return 'name'; };\n" +


Mime
View raw message