You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/12/28 06:16:58 UTC
[royale-compiler] 02/02: change output to exclude empty nodes since
XMLList is expecting to add those nodes itself
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit f242cd0b7acf7939a9b124c6466e7b9467ee7a64
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Dec 27 22:16:44 2018 -0800
change output to exclude empty nodes since XMLList is expecting to add those nodes itself
---
.../compiler/internal/codegen/js/jx/LiteralContainerEmitter.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
index ac0a3fa..c42c211 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
@@ -89,10 +89,14 @@ public class LiteralContainerEmitter extends JSSubEmitter implements
value = value.replace("\"", "\\\"");
value = value.replace("\r", "");
value = value.replace("\n", "\\n");
+ // skip the wrapping empty nodes. XMLList
+ // is expecting illegal xml (a sequence of children nodes
+ // and will wrap it
+ // in containing nodes
if (value.contentEquals("<>"))
- value = "<domparserdoesntlikeemptynodes>";
+ continue;
else if (value.contentEquals("</>"))
- value = "</domparserdoesntlikeemptynodes>";
+ continue;
write(value);
}
}