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

gregdove 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 34ff8d4  Fix for issue #92
34ff8d4 is described below

commit 34ff8d4944256c65bcfac8e9fc2868e53866b275
Author: greg-dove <[email protected]>
AuthorDate: Tue Jul 30 09:47:40 2019 +1200

    Fix for issue #92
---
 .../royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java | 6 +++++-
 .../internal/codegen/js/royale/TestRoyaleGlobalClasses.java         | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
index 0a57fd1..4de1d14 100644
--- 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -62,7 +62,7 @@ public class FunctionCallEmitter extends JSSubEmitter 
implements ISubEmitter<IFu
 
         if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
             cnode = cnode.getChild(0);
-
+        String postCallAppend = null;
         ASTNodeID id = cnode.getNodeID();
         if (id != ASTNodeID.SuperID)
         {
@@ -415,6 +415,7 @@ public class FunctionCallEmitter extends JSSubEmitter 
implements ISubEmitter<IFu
                                     //removeAt
                                     spliceArg = new NumericLiteralNode("1");
                                     
node.getArgumentsNode().addChild(spliceArg, 1);
+                                    postCallAppend = "[0]";
                                 }
                             } else {
                                 //default Vector implementation
@@ -578,6 +579,9 @@ public class FunctionCallEmitter extends JSSubEmitter 
implements ISubEmitter<IFu
 
                 getEmitter().emitArguments(node.getArgumentsNode());
     
+                if (postCallAppend != null) {
+                    write(postCallAppend);
+                }
                 //end wrap resolve
                 if (wrapResolve) {
                     write(ASEmitterTokens.PAREN_CLOSE);
diff --git 
a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
 
b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
index 74dd36a..23d50fa 100644
--- 
a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
+++ 
b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
@@ -517,7 +517,7 @@ public class TestRoyaleGlobalClasses extends 
TestGoogGlobalClasses
         IBinaryOperatorNode node = getBinaryNode("var a:Vector.<String> = new 
Vector.<String>(); a.removeAt(2)");
         IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
         asBlockWalker.visitFunctionCall(parentNode);
-        assertOut("a.splice(2, 1)");
+        assertOut("a.splice(2, 1)[0]");
     }
 
     @Test

Reply via email to