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/02/06 19:15:11 UTC

[royale-compiler] branch develop updated: compiler-jx: emitFunctionBlockHeader() does not emit self reference for package-level functions

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 11f65b1  compiler-jx: emitFunctionBlockHeader() does not emit self reference for package-level functions
11f65b1 is described below

commit 11f65b1d92428846cf7ff7a4c6170385ef55871f
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Feb 6 11:15:02 2019 -0800

    compiler-jx: emitFunctionBlockHeader() does not emit self reference for package-level functions
---
 .../royale/compiler/internal/codegen/js/goog/JSGoogEmitter.java      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/goog/JSGoogEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/goog/JSGoogEmitter.java
index ca3c7a5..341c9c7 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/goog/JSGoogEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/goog/JSGoogEmitter.java
@@ -703,7 +703,10 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         boolean isLocal = false;
         if (node.getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL)
             isLocal = true;
-        if (EmitterUtils.hasBody(node) && !isStatic && !isLocal)
+        boolean isPackage = false;
+        if (node.getFunctionClassification() == IFunctionDefinition.FunctionClassification.PACKAGE_MEMBER)
+        isPackage = true;
+        if (EmitterUtils.hasBody(node) && !isStatic && !isLocal && !isPackage)
             emitSelfReference(node);
 
         if (node.isConstructor()