flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [09/11] git commit: [flex-falcon] [refs/heads/develop] - "Bypass" XML in JS issue by writing the value as a string
Date Tue, 16 Sep 2014 14:02:01 GMT
"Bypass" XML in JS issue by writing the value as a string

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: bc97dc7c70b81e7bf0b267cc5a1e2f3498b366a0
Parents: 128904f
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Tue Sep 16 14:10:50 2014 +0200
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Tue Sep 16 14:10:50 2014 +0200

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/JSFlexJSEmitter.java  | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc97dc7c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index d8b18ae..454bae6 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -1552,13 +1552,18 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     @Override
     public void emitLiteral(ILiteralNode node)
     {
+        boolean isWritten = false;
+        
         String s = node.getValue(true);
         if (!(node instanceof RegExpLiteralNode))
         {
             if (node.getLiteralType() == LiteralType.XML)
             {
-                UnsupportedLanguageFeatureProblem problem = new UnsupportedLanguageFeatureProblem(node,
"XML");
-                getProblems().add(problem);
+                // ToDo (erikdebruin): VF2JS -> handle XML output properly...
+            	
+                write("'" + s + "'");
+                
+                isWritten = true;
             }
             s = s.replaceAll("\n", "__NEWLINE_PLACEHOLDER__");
             s = s.replaceAll("\r", "__CR_PLACEHOLDER__");
@@ -1576,6 +1581,10 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             s = s.replaceAll("__CR_PLACEHOLDER__", "\\\\r");
             s = s.replaceAll("__NEWLINE_PLACEHOLDER__", "\\\\n");
         }
-        write(s);
+        
+        if (!isWritten)
+        {
+            write(s);
+        }
     }
 }


Mime
View raw message