flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - fix super getter calls when node is an identifier
Date Tue, 14 Apr 2015 22:09:40 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 8596224ed -> 8df4395c6


fix super getter calls when node is an identifier


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

Branch: refs/heads/develop
Commit: 8df4395c65849581c7d1bb35562f50090f0cc9b2
Parents: 8596224
Author: Alex Harui <aharui@apache.org>
Authored: Tue Apr 14 15:09:00 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Apr 14 15:09:00 2015 -0700

----------------------------------------------------------------------
 .../js/flexjs/TestFlexJSAccessorMembers.java    | 20 +++++++-------
 .../codegen/js/flexjs/TestFlexJSAccessors.java  |  8 +++---
 .../codegen/js/flexjs/TestFlexJSClass.java      |  6 ++--
 .../flexjs/files/MyInitialView_result.js        |  3 ++
 .../flexjs/files/models/MyModel_result.js       | 29 +-------------------
 .../flexjs/projects/super/Base_result.js        | 15 ++--------
 .../flexjs/projects/super/Super_result.js       | 11 +-------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 28 ++++++++++++++-----
 8 files changed, 46 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
index 09bf25c..4d31db8 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
@@ -39,7 +39,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
         IClassNode node = (IClassNode) getNode("function get foo():int{}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n}}}\n);");
     }
 
     @Override
@@ -49,7 +49,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("function get foo():int{return -1;}",
     			IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return -1;\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return -1;\n}}}\n);");
     }
 
     @Override
@@ -59,7 +59,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public function get foo():int{return -1;}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return -1;\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return -1;\n}}}\n);");
     }
 
     @Override
@@ -69,7 +69,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public override function get foo():int{super.foo();
return -1;}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  org_apache_flex_utils_Language.superGetter(FalconTest_A, this, 'foo');\n
 return -1;\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nget: /** @this {FalconTest_A}
*/ function() {\n  org_apache_flex_utils_Language.superGetter(FalconTest_A, this, 'foo');\n
 return -1;\n}}}\n);");
     }
 
     @Override
@@ -79,7 +79,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public static function get foo():int{return
-1;}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.foo;\n\n;Object.defineProperties(FalconTest_A,
/** @lends {FalconTest_A} */ {\n/** @expose */\nfoo: {\nget: function() {\n  return -1;\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};Object.defineProperties(FalconTest_A,
/** @lends {FalconTest_A} */ {\n/** @expose */\nfoo: {\nget: function() {\n  return -1;\n}}}\n);");
     }
 
     @Override
@@ -89,7 +89,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("function set foo(value:int):void{}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n}}}\n);");
     }
 
     @Override
@@ -99,7 +99,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("function set foo(value:int):void{fetch('haai');}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n  fetch('haai');\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n  fetch('haai');\n}}}\n);");
     }
 
     @Override
@@ -109,7 +109,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public function set foo(value:int):void{}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.prototype.foo;\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {FalconTest_A}
*/ function(value) {\n}}}\n);");
     }
 
     @Override
@@ -119,7 +119,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public class B extends A { public override function
set foo(value:int):void {super.foo = value;} }; public class A extends B { public override
set foo(value:int):void{}}",
         		IClassNode.class, WRAP_LEVEL_PACKAGE);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this,
'constructor');\n};\ngoog.inherits(B, A);\n\n\n/**\n * @expose\n * @type {number}\n */\nB.prototype.foo;\n\n;Object.defineProperties(B.prototype,
/** @lends {B.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {B} */ function(value)
{\n  org_apache_flex_utils_Language.superSetter(B, this, 'foo', value);\n}}}\n);");
+        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this,
'constructor');\n};\ngoog.inherits(B, A);\n\n\nObject.defineProperties(B.prototype, /** @lends
{B.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {B} */ function(value) {\n  org_apache_flex_utils_Language.superSetter(B,
this, 'foo', value);\n}}}\n);");
     }
 
     @Override
@@ -129,7 +129,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
     	IClassNode node = (IClassNode) getNode("public static function set foo(value:int):void{}",
         		IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {number}\n */\nFalconTest_A.foo;\n\n;Object.defineProperties(FalconTest_A,
/** @lends {FalconTest_A} */ {\n/** @expose */\nfoo: {\nset: function(value) {\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};Object.defineProperties(FalconTest_A,
/** @lends {FalconTest_A} */ {\n/** @expose */\nfoo: {\nset: function(value) {\n}}}\n);");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
index 2844dcc..77d5a24 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
@@ -38,7 +38,7 @@ public class TestFlexJSAccessors extends ASTestBase
                 "public function doStuff():void {label = 'hello, bye'; var theLabel:String
= label;}; private var _label:String; public function get label():String {return _label};
public function set label(value:String):void {_label = value}; ",
                 IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = 'hello, bye';\n
 var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n
*/\nFalconTest_A.prototype._label;\n\n\n/**\n * @expose\n * @type {string}\n */\nFalconTest_A.prototype.label;\n\n;\n\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value)
{\n  this._label = value;\n}}}\n);";
+        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = 'hello, bye';\n
 var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n
*/\nFalconTest_A.prototype._label;\n\n\nObject.defineProperties(FalconTest_A.prototype, /**
@lends {FalconTest_A.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value)
{\n  this._label = value;\n}}}\n);";
         assertOut(expected);
     }
 
@@ -49,7 +49,7 @@ public class TestFlexJSAccessors extends ASTestBase
                 "public class B { public function B() {}; public function doStuff():void
{this.label = label + 'bye'; var theLabel:String = label;}; private var _label:String; public
function get label():String {return _label}; public function set label(value:String):void
{_label = value};}",
                 IClassNode.class, WRAP_LEVEL_PACKAGE);
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @expose\n
*/\nB.prototype.doStuff = function() {\n  this.label = this.label + 'bye';\n  var /** @type
{string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\n/**\n
* @expose\n * @type {string}\n */\nB.prototype.label;\n\n;\n\n\n;Object.defineProperties(B.prototype,
/** @lends {B.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {B} */ function()
{\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);";

+        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @expose\n
*/\nB.prototype.doStuff = function() {\n  this.label = this.label + 'bye';\n  var /** @type
{string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\nObject.defineProperties(B.prototype,
/** @lends {B.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {B} */ function()
{\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);";

         assertOut(expected);
     }
 
@@ -60,7 +60,7 @@ public class TestFlexJSAccessors extends ASTestBase
                 "public function doStuff():void {label = label + 'bye'; var theLabel:String
= label;}; private var _label:String; public function get label():String {return _label};
public function set label(value:String):void {_label = value}; ",
                 IClassNode.class, WRAP_LEVEL_CLASS);
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = this.label +
'bye';\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type
{string}\n */\nFalconTest_A.prototype._label;\n\n\n/**\n * @expose\n * @type {string}\n */\nFalconTest_A.prototype.label;\n\n;\n\n\n;Object.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value)
{\n  this._label = value;\n}}}\n);";
+        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @expose\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = this.label +
'bye';\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type
{string}\n */\nFalconTest_A.prototype._label;\n\n\nObject.defineProperties(FalconTest_A.prototype,
/** @lends {FalconTest_A.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {FalconTest_A}
*/ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value)
{\n  this._label = value;\n}}}\n);";
         assertOut(expected);
     }
     
@@ -71,7 +71,7 @@ public class TestFlexJSAccessors extends ASTestBase
                 "public class B { public function B() {}; public function doStuff():void
{label = this.label; var theLabel:String = label;}; private var _label:String; public function
get label():String {return _label}; public function set label(value:String):void {_label =
value};}",
                 IClassNode.class, WRAP_LEVEL_PACKAGE);
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @expose\n
*/\nB.prototype.doStuff = function() {\n  this.label = this.label;\n  var /** @type {string}
*/ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\n/**\n
* @expose\n * @type {string}\n */\nB.prototype.label;\n\n;\n\n\n;Object.defineProperties(B.prototype,
/** @lends {B.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {B} */ function()
{\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);";
+        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @expose\n
*/\nB.prototype.doStuff = function() {\n  this.label = this.label;\n  var /** @type {string}
*/ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\nObject.defineProperties(B.prototype,
/** @lends {B.prototype} */ {\n/** @expose */\nlabel: {\nget: /** @this {B} */ function()
{\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);";
         assertOut(expected);
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
index 1eb5434..c2ece93 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
@@ -153,7 +153,7 @@ public class TestFlexJSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; public function
set baz(value:Object):void {}; public function set foo(value:Object):void {baz = value;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg_apache_flex_B = function() {\n};\n\n\n/**\n
* @expose\n * @type {Object}\n */\norg_apache_flex_B.prototype.baz;\n\n;\n\n\n/**\n * @expose\n
* @type {Object}\n */\norg_apache_flex_B.prototype.foo;\n\n;Object.defineProperties(org_apache_flex_B.prototype,
/** @lends {org_apache_flex_B.prototype} */ {\n/** @expose */\nbaz: {\nset: /** @this {org_apache_flex_B}
*/ function(value) {\n}},\n/** @expose */\nfoo: {\nset: /** @this {org_apache_flex_B} */ function(value)
{\n  this.baz = value;\n}}}\n);";
+        String expected = "/**\n * @constructor\n */\norg_apache_flex_B = function() {\n};\n\n\nObject.defineProperties(org_apache_flex_B.prototype,
/** @lends {org_apache_flex_B.prototype} */ {\n/** @expose */\nbaz: {\nset: /** @this {org_apache_flex_B}
*/ function(value) {\n}},\n/** @expose */\nfoo: {\nset: /** @this {org_apache_flex_B} */ function(value)
{\n  this.baz = value;\n}}}\n);";
         assertOut(expected);
     }
 
@@ -162,7 +162,7 @@ public class TestFlexJSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; override
public function set foo(value:Object):void {super.foo = value;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg_apache_flex_B = function() {\n};\n\n\n/**\n
* @expose\n * @type {Object}\n */\norg_apache_flex_B.prototype.foo;\n\n;Object.defineProperties(org_apache_flex_B.prototype,
/** @lends {org_apache_flex_B.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {org_apache_flex_B}
*/ function(value) {\n  foo = value;\n}}}\n);";
+        String expected = "/**\n * @constructor\n */\norg_apache_flex_B = function() {\n};\n\n\nObject.defineProperties(org_apache_flex_B.prototype,
/** @lends {org_apache_flex_B.prototype} */ {\n/** @expose */\nfoo: {\nset: /** @this {org_apache_flex_B}
*/ function(value) {\n  foo = value;\n}}}\n);";
         assertOut(expected);
     }
 
@@ -214,7 +214,7 @@ public class TestFlexJSClass extends TestGoogClass
                 + "foo_bar function get foo6():Object{return null;}"
                 + "foo_bar function set foo6(value:Object):void{}" + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg_apache_flex_A = function() {\n};\n\n\n/**\n
* @expose\n * @type {Object}\n */\norg_apache_flex_A.prototype.foo1;\n\n;\n\n\n;\n\n\n/**\n
* @protected\n * @type {Object}\n */\norg_apache_flex_A.prototype.foo2;\n\n;\n\n\n;\n\n\n/**\n
* @private\n * @type {Object}\n */\norg_apache_flex_A.prototype.foo3;\n\n;\n\n\n;\n\n\n/**\n
* @expose\n * @type {Object}\n */\norg_apache_flex_A.prototype.foo5;\n\n;\n\n\n;\n\n\n/**\n
* @expose\n * @type {Object}\n */\norg_apache_flex_A.prototype.foo6;\n\n;\n\n\n;Object.defineProperties(org_apache_flex_A.prototype,
/** @lends {org_apache_flex_A.prototype} */ {\n/** @expose */\nfoo5: {\nget: /** @this {org_apache_flex_A}
*/ function() {\n  return null;\n},\nset: /** @this {org_apache_flex_A} */ function(value)
{\n}},\n/** @expose */\nfoo3: {\nget: /** @this {org_apache_flex_A} */ function() {\n  return
null;\n},\nset: /** @this {org_apache_flex_A} */ function(value) {\n}},\n/** @expose */\nfoo2:
{\nget: /**
  @this {org_apache_flex_A} */ function() {\n  return null;\n},\nset: /** @this {org_apache_flex_A}
*/ function(value) {\n}},\n/** @expose */\nfoo1: {\nget: /** @this {org_apache_flex_A} */
function() {\n  return null;\n},\nset: /** @this {org_apache_flex_A} */ function(value) {\n}},\n/**
@expose */\nfoo6: {\nget: /** @this {org_apache_flex_A} */ function() {\n  return null;\n},\nset:
/** @this {org_apache_flex_A} */ function(value) {\n}}}\n);");
+        assertOut("/**\n * @constructor\n */\norg_apache_flex_A = function() {\n};\n\n\nObject.defineProperties(org_apache_flex_A.prototype,
/** @lends {org_apache_flex_A.prototype} */ {\n/** @expose */\nfoo5: {\nget: /** @this {org_apache_flex_A}
*/ function() {\n  return null;\n},\nset: /** @this {org_apache_flex_A} */ function(value)
{\n}},\n/** @expose */\nfoo3: {\nget: /** @this {org_apache_flex_A} */ function() {\n  return
null;\n},\nset: /** @this {org_apache_flex_A} */ function(value) {\n}},\n/** @expose */\nfoo2:
{\nget: /** @this {org_apache_flex_A} */ function() {\n  return null;\n},\nset: /** @this
{org_apache_flex_A} */ function(value) {\n}},\n/** @expose */\nfoo1: {\nget: /** @this {org_apache_flex_A}
*/ function() {\n  return null;\n},\nset: /** @this {org_apache_flex_A} */ function(value)
{\n}},\n/** @expose */\nfoo6: {\nget: /** @this {org_apache_flex_A} */ function() {\n  return
null;\n},\nset: /** @this {org_apache_flex_A} */ function(value) {\n}}}\n);");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
index 6062278..f86853f 100644
--- a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
@@ -247,6 +247,9 @@ MyInitialView.prototype.timerHandler = function(event) {
 };
 
 
+
+
+
 Object.defineProperties(MyInitialView.prototype, /** @lends {MyInitialView.prototype} */
{
 /** @expose */
 comboBoxValue: {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/test-files/flexjs/files/models/MyModel_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/models/MyModel_result.js b/compiler.jx.tests/test-files/flexjs/files/models/MyModel_result.js
index 5921236..6f2c3de 100644
--- a/compiler.jx.tests/test-files/flexjs/files/models/MyModel_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/models/MyModel_result.js
@@ -41,18 +41,6 @@ models_MyModel.prototype._labelText;
 
 
 /**
- * @expose
- * @type {string}
- */
-models_MyModel.prototype.labelText;
-
-;
-
-
-;
-
-
-/**
  * @private
  * @type {Array}
  */
@@ -60,28 +48,13 @@ models_MyModel.prototype._strings = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
 
 
 /**
- * @expose
- * @type {Array}
- */
-models_MyModel.prototype.strings;
-
-;
-
-
-/**
  * @private
  * @type {Array}
  */
 models_MyModel.prototype._cities = ["London", "Miami", "Paris", "Sydney", "Tokyo"];
 
 
-/**
- * @expose
- * @type {Array}
- */
-models_MyModel.prototype.cities;
-
-;Object.defineProperties(models_MyModel.prototype, /** @lends {models_MyModel.prototype}
*/ {
+Object.defineProperties(models_MyModel.prototype, /** @lends {models_MyModel.prototype} */
{
 /** @expose */
 labelText: {
 get: /** @this {models_MyModel} */ function() {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js b/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js
index e9f3263..ddbe449 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js
@@ -36,23 +36,14 @@ Base = function() {
 goog.inherits(Base, Super);
 
 
-/**
- * @expose
- * @type {string}
- */
-Base.prototype.text;
-
-;
-
-
-;Object.defineProperties(Base.prototype, /** @lends {Base.prototype} */ {
+Object.defineProperties(Base.prototype, /** @lends {Base.prototype} */ {
 /** @expose */
 text: {
 get: /** @this {Base} */ function() {
-  return "A" + text;
+  return "A" + org_apache_flex_utils_Language.superGetter(Base, this, 'text');
 },
 set: /** @this {Base} */ function(value) {
-  if (value != text) {
+  if (value != org_apache_flex_utils_Language.superGetter(Base, this, 'text')) {
     org_apache_flex_utils_Language.superSetter(Base, this, 'text', "B" + value);
   }
 }}}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js b/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js
index d35c1e0..9ccdb57 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js
@@ -37,16 +37,7 @@ Super = function() {
 Super.prototype._text = '';
 
 
-/**
- * @expose
- * @type {string}
- */
-Super.prototype.text;
-
-;
-
-
-;Object.defineProperties(Super.prototype, /** @lends {Super.prototype} */ {
+Object.defineProperties(Super.prototype, /** @lends {Super.prototype} */ {
 /** @expose */
 text: {
 get: /** @this {Super} */ function() {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8df4395c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index c29a9bc..5ca8a61 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -216,11 +216,13 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             else if (dnode.getNodeID() == ASTNodeID.GetterID
                     || dnode.getNodeID() == ASTNodeID.SetterID)
             {
-                writeNewline();
-                writeNewline();
-                writeNewline();
+                //writeNewline();
+                //writeNewline();
+                //writeNewline();
                 emitAccessors((IAccessorNode) dnode);
-                write(ASEmitterTokens.SEMICOLON);
+                //this shouldn't write anything, just set up
+                //a data structure for emitASGettersAndSetters
+                //write(ASEmitterTokens.SEMICOLON);
             }
             else if (dnode.getNodeID() == ASTNodeID.BindableVariableID)
             {
@@ -241,6 +243,9 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     {
         if (!propertyMap.isEmpty())
         {
+            writeNewline();
+            writeNewline();
+            writeNewline();
             write(JSGoogEmitterTokens.OBJECT);
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.DEFINE_PROPERTIES);
@@ -590,7 +595,6 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 	    write(ASEmitterTokens.BLOCK_CLOSE.getToken());
     }
 
-    /*
     @Override
     protected void emitAccessors(IAccessorNode node)
     {
@@ -604,6 +608,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         }
     }
     
+    /*
     @Override
     public void emitMethod(IFunctionNode node)
     {
@@ -1360,6 +1365,10 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             if (!(leftNode instanceof ILanguageIdentifierNode && ((ILanguageIdentifierNode)
leftNode)
                         .getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS))
             {
+                IDefinition rightDef = null;
+                if (rightNode instanceof IIdentifierNode)
+                	rightDef = ((IIdentifierNode) rightNode).resolve(project);
+                
             	if (rightNode instanceof UnaryOperatorAtNode)
                 {
             		// ToDo (erikdebruin): properly handle E4X
@@ -1394,7 +1403,8 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                     write(node.getOperator().getOperatorText());
                 }
             	else if (leftNode.getNodeID() == ASTNodeID.SuperID &&
-            			rightNode.getNodeID() == ASTNodeID.GetterID)
+            			(rightNode.getNodeID() == ASTNodeID.GetterID ||
+            			 (rightDef != null && rightDef instanceof AccessorDefinition)))
             	{
             		// setter is handled in binaryOperator
                     write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
@@ -1408,8 +1418,12 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     		        write(ASEmitterTokens.THIS);
     	            writeToken(ASEmitterTokens.COMMA);
     	            write(ASEmitterTokens.SINGLE_QUOTE);
-    	            write(((GetterNode)rightNode).getName());
+    	            if (rightDef != null)
+    	            	write(rightDef.getBaseName());
+    	            else
+    	            	write(((GetterNode)rightNode).getName());
     	            write(ASEmitterTokens.SINGLE_QUOTE);
+    	            write(ASEmitterTokens.PAREN_CLOSE);
                     continueWalk = false;            		
             	}
             }


Mime
View raw message