You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2018/08/07 10:32:23 UTC

[royale-compiler] branch develop updated: Don’t add “node.” to local variables

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

harbs 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 c1409d3  Don’t add “node.” to local variables
c1409d3 is described below

commit c1409d3a825766655f1bcb87847b16928df408da
Author: Harbs <ha...@in-tools.com>
AuthorDate: Tue Aug 7 13:32:15 2018 +0300

    Don’t add “node.” to local variables
---
 .../compiler/internal/codegen/js/utils/EmitterUtils.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
index 0976b78..d7ecbc7 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
@@ -441,13 +441,13 @@ public class EmitterUtils
         IDefinition nodeDef = node.resolve(project);
 
         IASNode parentNode = node.getParent();
-        ASTNodeID parentNodeId = parentNode.getNodeID();
+//        ASTNodeID parentNodeId = parentNode.getNodeID();
 
         IASNode firstChild = parentNode.getChild(0);
 
-        final IClassDefinition thisClass = model.getCurrentClass();
+//        final IClassDefinition thisClass = model.getCurrentClass();
 
-        boolean identifierIsMemberAccess = parentNodeId == ASTNodeID.MemberAccessExpressionID;
+//        boolean identifierIsMemberAccess = parentNodeId == ASTNodeID.MemberAccessExpressionID;
 
         if (parentNode instanceof IUnaryOperatorNode)
         	return false;
@@ -457,6 +457,14 @@ public class EmitterUtils
             return false;
         if (nodeDef instanceof ClassDefinition)
             return false;
+        if (nodeDef instanceof VariableDefinition)
+        {
+        		List<IVariableNode> list = model.getVars();
+        		for (IVariableNode element : list) {
+        		    if(element.getQualifiedName().equals(((IIdentifierNode)node).getName()))
+        		    		return false;
+        		}
+        }
         
         if (node == firstChild) 
         	return true;