flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/4] git commit: [flex-falcon] [refs/heads/develop] - swap out Vector for Array
Date Fri, 30 Oct 2015 06:53:06 GMT
swap out Vector for Array


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

Branch: refs/heads/develop
Commit: 17a773303b9a334a62b09bb8b4d70d412e4f7293
Parents: 5bc1462
Author: Alex Harui <aharui@apache.org>
Authored: Thu Oct 29 23:25:07 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Oct 29 23:25:07 2015 -0700

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/TestFlexJSExpressions.java    | 2 +-
 .../internal/codegen/js/flexjs/TestFlexJSFieldMembers.java   | 4 ++--
 .../internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java  | 8 ++++----
 .../codegen/js/flexjs/TestFlexJSGlobalFunctions.java         | 2 +-
 .../internal/codegen/js/flexjs/JSFlexJSDocEmitter.java       | 3 +++
 5 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17a77330/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
index f880cf3..fdb40ec 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
@@ -694,7 +694,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions
                 IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
         asBlockWalker.visitFunction(node);
         // String.length is a getter but is a property in JS, so don't generate set_length()
call.
-        assertOut("/**\n * @export\n * @return {number}\n */\nfoo.bar.B.prototype.b = function()
{\n  var /** @type {Vector.<string>} */ a;\n  return a.length;\n}");
+        assertOut("/**\n * @export\n * @return {number}\n */\nfoo.bar.B.prototype.b = function()
{\n  var /** @type {Array} */ a;\n  return a.length;\n}");
     }
 
     //----------------------------------

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17a77330/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
index 820cd51..84f652e 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
@@ -98,7 +98,7 @@ public class TestFlexJSFieldMembers extends TestGoogFieldMembers
     {
         IVariableNode node = getField("protected var foo:Vector.<Foo>;");
         asBlockWalker.visitVariable(node);
-        assertOut("/**\n * @protected\n * @type {Vector.<Foo>}\n */\nFalconTest_A.prototype.foo");
+        assertOut("/**\n * @protected\n * @type {Array}\n */\nFalconTest_A.prototype.foo");
     }
 
     @Override
@@ -107,7 +107,7 @@ public class TestFlexJSFieldMembers extends TestGoogFieldMembers
     {
         IVariableNode node = getField("protected var foo:Vector.<Vector.<Vector.<Foo>>>;");
         asBlockWalker.visitVariable(node);
-        assertOut("/**\n * @protected\n * @type {Vector.<Vector.<Vector.<Foo>>>}\n
*/\nFalconTest_A.prototype.foo");
+        assertOut("/**\n * @protected\n * @type {Array}\n */\nFalconTest_A.prototype.foo");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17a77330/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
index 8b70393..37529e9 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
@@ -53,7 +53,7 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
     {
         IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(['Hello',
'World']);");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Vector.<string>} */ a = new Array(['Hello', 'World'])");
+        assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
     }
 
     @Test
@@ -61,7 +61,7 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
     {
         IVariableNode node = getVariable("var a:Vector.<String> = new <String>[];");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Vector.<string>} */ a = []");
+        assertOut("var /** @type {Array} */ a = []");
     }
 
     @Test
@@ -69,7 +69,7 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
     {
         IVariableNode node = getVariable("var a:Vector.<int> = new <int>[0, 1,
2, 3];");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Vector.<int>} */ a = [0, 1, 2, 3]");
+        assertOut("var /** @type {Array} */ a = [0, 1, 2, 3]");
     }
 
     @Test
@@ -77,6 +77,6 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
     {
         IVariableNode node = getVariable("var a:Vector.<String> = new <String>[\"one\",
\"two\", \"three\";");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Vector.<string>} */ a = [\"one\", \"two\", \"three\"]");
+        assertOut("var /** @type {Array} */ a = [\"one\", \"two\", \"three\"]");
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17a77330/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
index 298ef08..0ba898e 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
@@ -84,7 +84,7 @@ public class TestFlexJSGlobalFunctions extends TestGoogGlobalFunctions
     {
         IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(['Hello',
'World']);");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Vector.<string>} */ a = Array(['Hello', 'World'])");
+        assertOut("var /** @type {Array} */ a = Array(['Hello', 'World'])");
     }
 
     @Ignore

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17a77330/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
index 4a3a613..4bae36d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -78,6 +78,9 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
             if (classIgnoreList.contains(pname + "." + name))
                 return IASLanguageConstants.Object;
         }
+        if (name.matches("Vector\\.<.*>"))
+        	return IASLanguageConstants.Array;
+        
         name = super.convertASTypeToJS(name, pname);
         return formatQualifiedName(name);
     }


Mime
View raw message