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 2020/04/29 17:36:14 UTC

[royale-compiler] branch develop updated: IdentifierEmitter: use some constants instead of string literals

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


The following commit(s) were added to refs/heads/develop by this push:
     new b1e5b51  IdentifierEmitter: use some constants instead of string literals
b1e5b51 is described below

commit b1e5b518ad996af592c59e1ce2f8cc7d7bfb5d29
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Apr 29 10:35:40 2020 -0700

    IdentifierEmitter: use some constants instead of string literals
---
 .../internal/codegen/js/jx/IdentifierEmitter.java        | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/IdentifierEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/IdentifierEmitter.java
index 00f82b9..595a1e2 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/IdentifierEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/IdentifierEmitter.java
@@ -92,7 +92,9 @@ public class IdentifierEmitter extends JSSubEmitter implements
                 startMapping(parentNode);
                 if(initialValue instanceof String)
                 {
-                    write("\"" + initialValue + "\"");
+                    write(ASEmitterTokens.DOUBLE_QUOTE);
+                    write((String) initialValue);
+                    write(ASEmitterTokens.DOUBLE_QUOTE);
                 }
                 else if(initialValue == ABCConstants.UNDEFINED_VALUE)
                 {
@@ -358,7 +360,11 @@ public class IdentifierEmitter extends JSSubEmitter implements
                     }
                     else if (identifierIsAccessorFunction && isStatic)
                     {
-                    	write("[\"" +node.getName() + "\"]");
+                        write(ASEmitterTokens.SQUARE_OPEN);
+                        write(ASEmitterTokens.DOUBLE_QUOTE);
+                        write(node.getName());
+                        write(ASEmitterTokens.DOUBLE_QUOTE);
+                        write(ASEmitterTokens.SQUARE_CLOSE);
                     }
                 	else
                 	{
@@ -392,7 +398,11 @@ public class IdentifierEmitter extends JSSubEmitter implements
                 }
                 else if (identifierIsAccessorFunction && isStatic)
                 {
-                	write("[\"" + qname + "\"]");
+                    write(ASEmitterTokens.SQUARE_OPEN);
+                    write(ASEmitterTokens.DOUBLE_QUOTE);
+                	write(qname);
+                    write(ASEmitterTokens.DOUBLE_QUOTE);
+                    write(ASEmitterTokens.SQUARE_CLOSE);
                 }
                 else
                 {