You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/01/21 22:22:19 UTC

svn commit: r1436627 - in /flex/falcon/trunk/compiler.jx.tests: src/org/apache/flex/compiler/internal/js/codegen/goog/ test-files/

Author: erikdebruin
Date: Mon Jan 21 21:22:19 2013
New Revision: 1436627

URL: http://svn.apache.org/viewvc?rev=1436627&view=rev
Log:
- updated 'super' call test (which fails right now and is therefore ignored)
- added 'fully qualified name' test, in response to a finding I made when running the full 'goog' work flow with the publisher

Added:
    flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as   (with props)
    flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js   (with props)
Modified:
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
    flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as
    flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java?rev=1436627&r1=1436626&r2=1436627&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java Mon Jan 21 21:22:19 2013
@@ -23,6 +23,7 @@ import org.apache.flex.compiler.clients.
 import org.apache.flex.compiler.internal.as.codegen.TestWalkerBase;
 import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
 import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -48,6 +49,24 @@ public class TestGoogFile extends TestWa
         assertOut(getCodeFromFile("get-set_result", true));
     }
 
+    @Ignore
+    @Test
+    public void testFile_callsuper()
+    {
+    	// TODO (erikdebruin) handle various constructor super call edge cases first
+        IFileNode node = getFileNode("call-super", true);
+        visitor.visitFile(node);
+        assertOut(getCodeFromFile("call-super_result", true));
+    }
+
+    @Test
+    public void testFile_qualifynewobject()
+    {
+        IFileNode node = getFileNode("qualify-new-object", true);
+        visitor.visitFile(node);
+        assertOut(getCodeFromFile("qualify-new-object_result", true));
+    }
+
     @Override
     protected IBackend createBackend()
     {

Modified: flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as?rev=1436627&r1=1436626&r2=1436627&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as (original)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as Mon Jan 21 21:22:19 2013
@@ -1,20 +1,24 @@
 package org.apache.flex
 {
 
+import flash.events.IEventDispatcher;
+
 import spark.components.Button;
 
-public dynamic class A extends spark.components.Button
+public dynamic class A extends Button implements IEventDispatcher
 {
-	public function A()
+	public function A(z:String)
 	{
-		super();
+		super(z);
 	}
 	
-	public function hasSuperCall(a:String, b:Number)
+	public function hasSuperCall(a:String, b:Number):String
 	{
 		super.hasSuperCall(a, b, 100);
 		
 		var result:String = myRegularFunctionCall(-1);
+		
+		return result;
 	}
 }
 }
\ No newline at end of file

Modified: flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js?rev=1436627&r1=1436626&r2=1436627&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js (original)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js Mon Jan 21 21:22:19 2013
@@ -1,21 +1,26 @@
 goog.provide('org.apache.flex.A');
 
+goog.require('flash.events.IEventDispatcher');
 goog.require('spark.components.Button');
 
 /**
  * @constructor
  * @extends {spark.components.Button}
+ * @implements {flash.events.IEventDispatcher}
+ * @param {string} z
  */
-org.apache.flex.A = function() {
-	goog.base(this);
+org.apache.flex.A = function(z) {
+	goog.base(this, z);
 }
 goog.inherits(org.apache.flex.A, spark.components.Button);
 
 /**
  * @param {string} a
  * @param {number} b
+ * @return {string}
  */
 org.apache.flex.A.prototype.hasSuperCall = function(a, b) {
 	goog.base(this, 'hasSuperCall', a, b, 100);
 	var /** @type {string} */ result = myRegularFunctionCall(-1);
+	return result;
 };
\ No newline at end of file

Added: flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as?rev=1436627&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as (added)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as Mon Jan 21 21:22:19 2013
@@ -0,0 +1,15 @@
+package org.apache.flex
+{
+
+import spark.components.Button;
+
+public class A
+{
+	public function A() {}
+	
+	public function init()
+	{
+		var btn:Button = new Button();
+	}
+}
+}
\ No newline at end of file

Propchange: flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js?rev=1436627&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js (added)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js Mon Jan 21 21:22:19 2013
@@ -0,0 +1,13 @@
+goog.provide('org.apache.flex.A');
+
+goog.require('spark.components.Button');
+
+/**
+ * @constructor
+ */
+org.apache.flex.A = function() {
+};
+
+org.apache.flex.A.prototype.init = function() {
+	var /** @type {spark.components.Button} */ btn = new spark.components.Button();
+};
\ No newline at end of file

Propchange: flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js
------------------------------------------------------------------------------
    svn:eol-style = native