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/02/22 17:42:11 UTC

[royale-compiler] branch develop updated (9ec3fb8 -> e8c6a62)

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

aharui pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git.


    from 9ec3fb8  don't rename global selector to * selector
     new 1827a70  GCC says Object doesn't coerce to Function so we have to type cast it
     new e8c6a62  we've been outputting incorrect interfaces for a while now.  This should fix it

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../compiler/internal/codegen/js/jx/AsIsEmitter.java    |  9 +++++++++
 .../internal/codegen/js/jx/InterfaceEmitter.java        | 17 +++++++++++------
 .../internal/codegen/js/royale/TestRoyaleInterface.java |  4 ++--
 .../royale/projects/overrides/interfaces/IA_result.js   |  6 ++++++
 4 files changed, 28 insertions(+), 8 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

[royale-compiler] 01/02: GCC says Object doesn't coerce to Function so we have to type cast it

Posted by ah...@apache.org.
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 1827a703454842da07c08ccd47aeb8a2678086aa
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Feb 22 09:41:13 2018 -0800

    GCC says Object doesn't coerce to Function so we have to type cast it
---
 .../royale/compiler/internal/codegen/js/jx/AsIsEmitter.java      | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AsIsEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AsIsEmitter.java
index 9c1fe5c..67346f3 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AsIsEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AsIsEmitter.java
@@ -21,6 +21,7 @@ package org.apache.royale.compiler.internal.codegen.js.jx;
 
 import org.apache.royale.compiler.asdoc.royale.ASDocComment;
 import org.apache.royale.compiler.codegen.js.IJSEmitter;
+import org.apache.royale.compiler.constants.IASLanguageConstants;
 import org.apache.royale.compiler.definitions.IClassDefinition;
 import org.apache.royale.compiler.definitions.IDefinition;
 import org.apache.royale.compiler.internal.codegen.as.ASEmitterTokens;
@@ -123,7 +124,15 @@ public class AsIsEmitter extends JSSubEmitter
             }
             if (!emit)
             {
+            	if (dnode.getQualifiedName().equals(IASLanguageConstants.Function))
+            	{
+            		write(" /** @type {Function} */ (");
+            	}
                 getWalker().walk(left);
+            	if (dnode.getQualifiedName().equals(IASLanguageConstants.Function))
+            	{
+            		write(")");
+            	}
                 return;
             }
         }

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

[royale-compiler] 02/02: we've been outputting incorrect interfaces for a while now. This should fix it

Posted by ah...@apache.org.
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 e8c6a62ee2ace622d90f932da6f00e2410d55a49
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Feb 22 09:41:44 2018 -0800

    we've been outputting incorrect interfaces for a while now.  This should fix it
---
 .../internal/codegen/js/jx/InterfaceEmitter.java        | 17 +++++++++++------
 .../internal/codegen/js/royale/TestRoyaleInterface.java |  4 ++--
 .../royale/projects/overrides/interfaces/IA_result.js   |  6 ++++++
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/InterfaceEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/InterfaceEmitter.java
index 2f4f2b8..0221afc 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/InterfaceEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/InterfaceEmitter.java
@@ -72,10 +72,10 @@ public class InterfaceEmitter extends JSSubEmitter implements
             write(ASEmitterTokens.SEMICOLON);
         }
 
+        JSRoyaleDocEmitter doc = (JSRoyaleDocEmitter) getEmitter()
+        .getDocEmitter();
   	    if (!getEmitter().getModel().isExterns)
   	    {
-  	        JSRoyaleDocEmitter doc = (JSRoyaleDocEmitter) getEmitter()
-  	        .getDocEmitter();
   		    writeNewline();
   		    writeNewline();
   		    writeNewline();
@@ -100,8 +100,9 @@ public class InterfaceEmitter extends JSSubEmitter implements
             boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
                     || mnode.getNodeID() == ASTNodeID.SetterID;
 
+            String memberName = mnode.getQualifiedName();
             if (!isAccessor
-                    || !getModel().getInterfacePropertyMap().contains(qname))
+                    || !getModel().getInterfacePropertyMap().contains(memberName))
             {
                 writeNewline();
 
@@ -119,17 +120,21 @@ public class InterfaceEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.SPACE);
                     write(JSDocEmitterTokens.JSDOC_CLOSE);
                 }
+                else
+                {
+                	doc.emitMethodDoc((IFunctionNode)mnode, project);
+                }
                 write(getEmitter().formatQualifiedName(qname));
                 write(ASEmitterTokens.MEMBER_ACCESS);
                 write(JSEmitterTokens.PROTOTYPE);
                 write(ASEmitterTokens.MEMBER_ACCESS);
-                write(mnode.getQualifiedName());
+                write(memberName);
 
                 if (isAccessor
                         && !getModel().getInterfacePropertyMap()
-                                .contains(qname))
+                                .contains(memberName))
                 {
-                    getModel().getInterfacePropertyMap().add(qname);
+                    getModel().getInterfacePropertyMap().add(memberName);
                 }
                 else
                 {
diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleInterface.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleInterface.java
index d6bca65..2ee8941 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleInterface.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleInterface.java
@@ -90,7 +90,7 @@ public class TestRoyaleInterface extends TestGoogInterface
                 + "function baz1():Object;"
                 + "function baz2(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('IA', IA);\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('IA', IA);\n/**\n * @return {Object}\n */\nIA.prototype.baz1 = function() {\n};\n/**\n * @param {Object} value\n */\nIA.prototype.baz2 = function(value) {\n};");
     }
 
     @Override
@@ -103,7 +103,7 @@ public class TestRoyaleInterface extends TestGoogInterface
                 + "function baz1():Object;"
                 + "function baz2(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('IA', IA);\n/**  * @type {Object}\n */IA.prototype.foo1;\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('IA', IA);\n/**  * @type {Object}\n */IA.prototype.foo1;\n/**\n * @return {Object}\n */\nIA.prototype.baz1 = function() {\n};\n/**\n * @param {Object} value\n */\nIA.prototype.baz2 = function(value) {\n};");
     }
 
     protected IBackend createBackend()
diff --git a/compiler-jx/src/test/resources/royale/projects/overrides/interfaces/IA_result.js b/compiler-jx/src/test/resources/royale/projects/overrides/interfaces/IA_result.js
index f71d6ca..0a73f33 100644
--- a/compiler-jx/src/test/resources/royale/projects/overrides/interfaces/IA_result.js
+++ b/compiler-jx/src/test/resources/royale/projects/overrides/interfaces/IA_result.js
@@ -37,8 +37,14 @@ interfaces.IA = function() {
  * Prevent renaming of class. Needed for reflection.
  */
 goog.exportSymbol('interfaces.IA', interfaces.IA);
+/**
+ * @return {classes.B}
+ */
 interfaces.IA.prototype.someFunction = function() {
 };
+/**
+ * @return {interfaces.IB}
+ */
 interfaces.IA.prototype.someOtherFunction = function() {
 };
 

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.