You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/11/16 06:07:44 UTC

git commit: [flex-falcon] [refs/heads/develop] - need better test for same namespace

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 1d760a484 -> 6ec489b34


need better test for same namespace


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/6ec489b3
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/6ec489b3
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/6ec489b3

Branch: refs/heads/develop
Commit: 6ec489b3462f042a778e705752b3801c179077eb
Parents: 1d760a4
Author: Alex Harui <ah...@apache.org>
Authored: Tue Nov 15 21:58:43 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Nov 15 21:58:43 2016 -0800

----------------------------------------------------------------------
 .../internal/semantics/SemanticUtils.java       |  2 +-
 compiler/src/test/java/as/ASVariableTests.java  | 29 ++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6ec489b3/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/SemanticUtils.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/SemanticUtils.java b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/SemanticUtils.java
index 189ee5b..a67a880 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/SemanticUtils.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/SemanticUtils.java
@@ -757,7 +757,7 @@ public class SemanticUtils
         {
         	IDefinition otherDef = resolveCorrespondingAccessor(def);
             if (otherDef == null) return true;
-            if (otherDef.getNamespaceReference() != def.getNamespaceReference())
+            if (otherDef.getNamespaceReference().getBaseName() != def.getNamespaceReference().getBaseName())
             	return true;
         }
         else if ( def instanceof ConstantDefinition )

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6ec489b3/compiler/src/test/java/as/ASVariableTests.java
----------------------------------------------------------------------
diff --git a/compiler/src/test/java/as/ASVariableTests.java b/compiler/src/test/java/as/ASVariableTests.java
index e091883..c29b778 100644
--- a/compiler/src/test/java/as/ASVariableTests.java
+++ b/compiler/src/test/java/as/ASVariableTests.java
@@ -243,6 +243,35 @@ public class ASVariableTests extends ASFeatureTestsBase
     }
 
     @Test
+    public void ASVariableTests_setterBothCustomNamespace()
+    {
+    	// all tests can assume that flash.display.Sprite
+    	// flash.system.System and flash.events.Event have been imported
+        String[] imports = new String[]
+        {
+        	"import flash.utils.flash_proxy;",
+        	"use namespace flash_proxy;"
+        };
+        String[] declarations = new String[]
+        {
+            "private var _hello:String;",
+            "flash_proxy function get hello():String {",
+            "  return _hello; }",
+            "flash_proxy function set hello(value:String):void {",
+            "  _hello = value; }",
+            "public function test():void {",
+            "  this.hello = 'bye'; }",
+        };
+        String[] testCode = new String[]
+        {
+            "test();",
+            "assertEqual('hello', hello, 'bye');",
+        };
+        String source = getAS(imports, declarations, testCode, new String[0]);
+        compileAndRun(source);
+    }
+
+    @Test
     public void ASVariableTests_setterPrivateGetterPublic()
     {
     	// all tests can assume that flash.display.Sprite