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/10/07 11:55:17 UTC

[royale-compiler] branch develop updated: Switching around this check seems to fix the test cases.

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 4e87288  Switching around this check seems to fix the test cases.
4e87288 is described below

commit 4e87288b3760294302cb1fb02eb92da333958ad9
Author: Harbs <ha...@in-tools.com>
AuthorDate: Sun Oct 7 14:55:04 2018 +0300

    Switching around this check seems to fix the test cases.
    
    This is good for evaluated indexed access.
    There’s probably more complex string access that would fail.
---
 .../royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java    | 2 +-
 .../compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
index 0d94fac..33231d1 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
@@ -61,7 +61,7 @@ public class DynamicAccessEmitter extends JSSubEmitter implements
 	    	if (isXML)
 	    	{
 	    		ITypeDefinition type = rightOperandNode.resolveType(getProject());
-				if (!type.isInstanceOf("int", getProject()) && !type.isInstanceOf("uint", getProject()) && !type.isInstanceOf("Number", getProject()) )
+				if (type.isInstanceOf("String", getProject()))
 				{
 					String field = fjs.stringifyNode(rightOperandNode);
 					if (field.startsWith("\"@"))
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 84312d9..74fb242 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
@@ -604,7 +604,7 @@ public class TestRoyaleGlobalClasses extends TestGoogGlobalClasses
     		asBlockWalker.visitVariable(node);
         assertOut("var /** @type {XML} */ child = a.child('child')[a.child('child').length() - 1]");
     }
-    @Ignore
+    
     @Test
     public void testXMLListAssignment()
     {