Updated Branches:
  refs/heads/develop 5f4c8013a -> 18634f079

Created failing test for 'goog.base' for getter/setter accessors.

Signed-off-by: Erik de Bruin <[email protected]>


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

Branch: refs/heads/develop
Commit: 24694bb71d331f793c2b53937c42cf62b6c03f8d
Parents: 5f4c801
Author: Erik de Bruin <[email protected]>
Authored: Thu Nov 14 07:34:24 2013 +0100
Committer: Erik de Bruin <[email protected]>
Committed: Thu Nov 14 07:34:24 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/TestFlexJSProject.java    | 15 ++++++++
 .../test-files/flexjs/projects/super/Base.as    | 25 +++++++++++++
 .../flexjs/projects/super/Base_result.js        | 37 ++++++++++++++++++++
 .../test-files/flexjs/projects/super/Super.as   | 22 ++++++++++++
 .../flexjs/projects/super/Super_result.js       | 36 +++++++++++++++++++
 5 files changed, 135 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/24694bb7/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
 
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
index 7191660..b8b670b 100644
--- 
a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
+++ 
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
@@ -67,12 +67,27 @@ public class TestFlexJSProject extends TestGoogProject
         assertProjectOut(compiledFileNames, testDirPath);
     }
 
+    @Test
+    public void test_Super()
+    {
+        String testDirPath = projectDirPath + "/super";
+
+        String fileName = "Base";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
     @Override
     protected void addSourcePaths(List<File> sourcePaths)
     {
         sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
                 + File.separator + projectDirPath + "/interfaces")));
 
+        sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
+                + File.separator + projectDirPath + "/super")));
+
         super.addSourcePaths(sourcePaths);
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/24694bb7/compiler.jx.tests/test-files/flexjs/projects/super/Base.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/super/Base.as 
b/compiler.jx.tests/test-files/flexjs/projects/super/Base.as
new file mode 100644
index 0000000..22510c9
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Base.as
@@ -0,0 +1,25 @@
+package
+{
+       import Super;
+
+  public class Base extends Super
+  {
+    public function Base() 
+    {
+      super();
+    }; 
+
+    override public function get text():String 
+    {
+      return "A" + super.text;
+    };
+  
+    override public function set text(value:String):void 
+    {
+      if (value != super.text)
+      {
+        super.text = "B" + value;
+      }
+    };
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/24694bb7/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
new file mode 100644
index 0000000..ca387f0
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js
@@ -0,0 +1,37 @@
+goog.provide('Base');
+
+goog.require('Super');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ * @extends {Super}
+ */
+Base = function() {
+  goog.base(this);
+};
+goog.inherits(Base, Super);
+
+
+/**
+ * @expose
+ * @return {string}
+ * @override
+ */
+Base.prototype.get_text = function() {
+  return "A" + goog.base(this, "get_text");
+};
+
+
+/**
+ * @expose
+ * @param {string} value
+ * @override
+ */
+Base.prototype.set_text = function(value) {
+  if (value != goog.base(this, "get_text")) {
+    goog.base(this, "set_text", "B" + value);
+  }
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/24694bb7/compiler.jx.tests/test-files/flexjs/projects/super/Super.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/super/Super.as 
b/compiler.jx.tests/test-files/flexjs/projects/super/Super.as
new file mode 100644
index 0000000..4869541
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Super.as
@@ -0,0 +1,22 @@
+package
+{
+  public class Super
+  {
+    public function Super() {}; 
+
+    private var _text:String = '';
+  
+    public function get text():String 
+    {
+      return _text;
+    };
+  
+    public function set text(value:String):void 
+    {
+      if (value != _text)
+      {
+        _text = value;
+      }
+    };
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/24694bb7/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
new file mode 100644
index 0000000..08c344c
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/super/Super_result.js
@@ -0,0 +1,36 @@
+goog.provide('Super');
+
+
+
+/**
+ * @constructor
+ */
+Super = function() {
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Super.prototype._text = '';
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+Super.prototype.get_text = function() {
+  return this._text;
+};
+
+
+/**
+ * @expose
+ * @param {string} value
+ */
+Super.prototype.set_text = function(value) {
+  if (value != this._text) {
+    this._text = value;
+  }
+};
\ No newline at end of file

Reply via email to