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 2019/04/11 17:12:53 UTC

[royale-compiler] branch develop updated: compiler-jx: fixed issue where this. was incorrectly appended to a call to a locally defined function (closes #76)

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 ba64848  compiler-jx: fixed issue where this. was incorrectly appended to a call to a locally defined function (closes #76)
ba64848 is described below

commit ba64848a8b5780d4f35ccc27a18c7ff2384b0f15
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Apr 11 10:12:45 2019 -0700

    compiler-jx: fixed issue where this. was incorrectly appended to a call to a locally defined function (closes #76)
---
 .../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 250a67b..eeec0c2 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
@@ -361,6 +361,7 @@ public class EmitterUtils
             else
             {
                 boolean isFileOrPackageMember = false;
+                boolean isLocalFunction = false;
                 if(nodeDef instanceof FunctionDefinition)
                 {
                     FunctionClassification classification = ((FunctionDefinition) nodeDef).getFunctionClassification();
@@ -370,13 +371,20 @@ public class EmitterUtils
                         isFileOrPackageMember = true;
                     }
                     else if (!identifierIsMemberAccess && classification == FunctionClassification.CLASS_MEMBER &&
-                    		isClassMember(project, nodeDef, thisClass))
-                    	return true;
+                            isClassMember(project, nodeDef, thisClass))
+                    {
+                        return true;
+                    }
+                    else if (classification == FunctionClassification.LOCAL)
+                    {
+                        isLocalFunction = true;
+                    }
                 }
                 return parentNodeId == ASTNodeID.FunctionCallID
                         && !(nodeDef instanceof AccessorDefinition)
                         && !identifierIsMemberAccess
-                        && !isFileOrPackageMember;
+                        && !isFileOrPackageMember
+                        && !isLocalFunction;
             }
         }
         else