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/03/22 05:01:54 UTC
[1/5] git commit: [flex-falcon] [refs/heads/develop] - fix missing
Array constants. The cross-compiler generates the value as an inlined
constant
Repository: flex-falcon
Updated Branches:
refs/heads/develop 8ea2b9995 -> e736a1209
fix missing Array constants. The cross-compiler generates the value as an inlined constant
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/0d4d8711
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/0d4d8711
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/0d4d8711
Branch: refs/heads/develop
Commit: 0d4d871178f554617d552c00d1afa43093c18e7a
Parents: bc9edf3
Author: Alex Harui <ah...@apache.org>
Authored: Sun Mar 20 22:16:57 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 21 21:01:44 2016 -0700
----------------------------------------------------------------------
externs/js/missing.js | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/0d4d8711/externs/js/missing.js
----------------------------------------------------------------------
diff --git a/externs/js/missing.js b/externs/js/missing.js
index c0241d4..aedd69f 100644
--- a/externs/js/missing.js
+++ b/externs/js/missing.js
@@ -179,31 +179,31 @@ var console;
* @type {number}
* @const
*/
-Array.CASEINSENSITIVE = 1;
+Array.CASEINSENSITIVE;
/**
* @type {number}
* @const
*/
-Array.DESCENDING = 2;
+Array.DESCENDING;
/**
* @type {number}
* @const
*/
-Array.UNIQUESORT = 4;
+Array.UNIQUESORT;
/**
* @type {number}
* @const
*/
-Array.RETURNINDEXEDARRAY = 8;
+Array.RETURNINDEXEDARRAY;
/**
* @type {number}
* @const
*/
-Array.NUMERIC = 16;
+Array.NUMERIC;
/**
@@ -223,25 +223,25 @@ Array.prototype.removeAt = function(index) {};
* @type {number}
* @const
*/
-int.MAX_VALUE = 2147483648;
+int.MAX_VALUE;
/**
* @type {number}
* @const
*/
-int.MIN_VALUE = -2147483648;
+int.MIN_VALUE;
/**
* @type {number}
* @const
*/
-uint.MAX_VALUE = 4294967295;
+uint.MAX_VALUE;
/**
* @type {number}
* @const
*/
-uint.MIN_VALUE = 0;
+uint.MIN_VALUE;
[2/5] git commit: [flex-falcon] [refs/heads/develop] - allow
overridden return types to be a subclass of the base class return type.
Posted by ah...@apache.org.
allow overridden return types to be a subclass of the base class return type.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/bc9edf35
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/bc9edf35
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/bc9edf35
Branch: refs/heads/develop
Commit: bc9edf35a3f445cc50170b0c94e169570ab993ba
Parents: 8ea2b99
Author: Alex Harui <ah...@apache.org>
Authored: Fri Mar 18 13:42:22 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 21 21:01:44 2016 -0700
----------------------------------------------------------------------
.../codegen/js/flexjs/TestFlexJSProject.java | 43 +++++++++
.../flexjs/projects/bad_overrides/Test.as | 43 +++++++++
.../projects/bad_overrides/Test_result.js | 94 ++++++++++++++++++++
.../flexjs/projects/bad_overrides/classes/A.as | 41 +++++++++
.../projects/bad_overrides/classes/A_result.js | 92 +++++++++++++++++++
.../flexjs/projects/bad_overrides/classes/B.as | 25 ++++++
.../projects/bad_overrides/classes/B_result.js | 69 ++++++++++++++
.../flexjs/projects/bad_overrides/classes/C.as | 25 ++++++
.../projects/bad_overrides/classes/C_result.js | 69 ++++++++++++++
.../projects/bad_overrides/interfaces/IA.as | 28 ++++++
.../bad_overrides/interfaces/IA_result.js | 69 ++++++++++++++
.../projects/bad_overrides/interfaces/IB.as | 22 +++++
.../bad_overrides/interfaces/IB_result.js | 62 +++++++++++++
.../projects/bad_overrides/interfaces/IC.as | 22 +++++
.../bad_overrides/interfaces/IC_result.js | 62 +++++++++++++
.../flexjs/projects/overrides/Test.as | 43 +++++++++
.../flexjs/projects/overrides/Test_result.js | 94 ++++++++++++++++++++
.../flexjs/projects/overrides/classes/A.as | 41 +++++++++
.../projects/overrides/classes/A_result.js | 92 +++++++++++++++++++
.../flexjs/projects/overrides/classes/B.as | 25 ++++++
.../projects/overrides/classes/B_result.js | 69 ++++++++++++++
.../flexjs/projects/overrides/classes/C.as | 25 ++++++
.../projects/overrides/classes/C_result.js | 74 +++++++++++++++
.../flexjs/projects/overrides/interfaces/IA.as | 28 ++++++
.../projects/overrides/interfaces/IA_result.js | 69 ++++++++++++++
.../flexjs/projects/overrides/interfaces/IB.as | 22 +++++
.../projects/overrides/interfaces/IB_result.js | 62 +++++++++++++
.../flexjs/projects/overrides/interfaces/IC.as | 22 +++++
.../projects/overrides/interfaces/IC_result.js | 65 ++++++++++++++
.../internal/projects/FlexJSProject.java | 10 +++
.../definitions/FunctionDefinition.java | 2 +-
.../internal/projects/CompilerProject.java | 5 ++
.../compiler/projects/ICompilerProject.java | 7 ++
33 files changed, 1520 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/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 a82736c..feba941 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
@@ -126,6 +126,49 @@ public class TestFlexJSProject extends TestGoogProject
}
@Test
+ public void test_Overrides()
+ {
+ String testDirPath = projectDirPath + "/overrides";
+
+ String fileName = "Test";
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/overrides").getPath();
+
+ StringBuilder sb = new StringBuilder();
+ List<String> compiledFileNames = compileProject(fileName, testDirPath, sb, false);
+
+ assertProjectOut(compiledFileNames, testDirPath);
+ }
+
+ @Test
+ public void test_Bad_Overrides()
+ {
+ String testDirPath = projectDirPath + "/bad_overrides";
+
+ String fileName = "Test";
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/bad_overrides").getPath();
+
+ StringBuilder sb = new StringBuilder();
+ compileProject(fileName, testDirPath, sb, false);
+
+ String out = sb.toString();
+ out = out.replace("\\", "/");
+
+ String expected = "test-files/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
+ "interface method someFunction in interface IA is implemented with an incompatible signature in class Test\n" +
+ "test-files/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
+ "interface method someOtherFunction in interface IA is implemented with an incompatible signature in class Test\n" +
+ "test-files/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
+ "Incompatible override.\n" +
+ "test-files/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
+ "Incompatible override.\n";
+ assertThat(out, is(expected));
+ }
+
+ @Test
public void test_PackageConflict_AmbiguousDefinition()
{
String testDirPath = projectDirPath + "/package_conflicts_ambiguous_definition";
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test.as
new file mode 100644
index 0000000..9190d6e
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+ import classes.A;
+ import classes.C;
+ import interfaces.IC;
+
+ public class Test extends A
+ {
+ public function Test()
+ {
+ super();
+ }
+
+ override public function someFunction():C
+ {
+ return null;
+ }
+
+ override public function someOtherFunction():IC
+ {
+ return null;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test_result.js
new file mode 100644
index 0000000..8f8fd20
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/Test_result.js
@@ -0,0 +1,94 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ */
+Test = function() {
+ Test.base(this, 'constructor');
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someFunction = function() {
+ return null;
+};
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someOtherFunction = function() {
+ return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Test', Test);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Test.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'Test': { type: '', declaredBy: 'Test'},
+ 'someFunction': { type: 'C', declaredBy: 'Test'},
+ 'someOtherFunction': { type: 'IC', declaredBy: 'Test'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A.as
new file mode 100644
index 0000000..004a607
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ import interfaces.IA;
+ import interfaces.IB;
+
+ public class A implements IA
+ {
+ public function A()
+ {
+ }
+
+ public function someFunction():B
+ {
+ return null;
+ }
+
+ public function someOtherFunction():IB
+ {
+ return null;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A_result.js
new file mode 100644
index 0000000..e3320af
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/A_result.js
@@ -0,0 +1,92 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.A');
+
+goog.require('interfaces.IA');
+
+
+
+/**
+ * @constructor
+ * @implements {interfaces.IA}
+ */
+classes.A = function() {
+};
+
+
+/**
+ * @export
+ * @return {classes.B}
+ */
+classes.A.prototype.someFunction = function() {
+ return null;
+};
+
+
+/**
+ * @export
+ * @return {interfaces.IB}
+ */
+classes.A.prototype.someOtherFunction = function() {
+ return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}], interfaces: [interfaces.IA] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.A', classes.A);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.A.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'A': { type: '', declaredBy: 'classes.A'},
+ 'someFunction': { type: 'B', declaredBy: 'classes.A'},
+ 'someOtherFunction': { type: 'IB', declaredBy: 'classes.A'}
+ };
+ }
+ };
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ public class B
+ {
+ public function B() {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B_result.js
new file mode 100644
index 0000000..8aaa2f7
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/B_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.B', classes.B);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.B.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'B': { type: '', declaredBy: 'classes.B'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C.as
new file mode 100644
index 0000000..d414a26
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ public class C
+ {
+ public function C() {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C_result.js
new file mode 100644
index 0000000..46f094f
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/classes/C_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.C');
+
+
+
+/**
+ * @constructor
+ */
+classes.C = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.C', classes.C);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.C.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'C': { type: '', declaredBy: 'classes.C'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA.as
new file mode 100644
index 0000000..6f363bc
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ import classes.B;
+
+ public interface IA
+ {
+ function someFunction():B;
+ function someOtherFunction():IB;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA_result.js
new file mode 100644
index 0000000..04220e1
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IA_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IA');
+
+
+
+
+/**
+ * @interface
+ */
+interfaces.IA = function() {
+};
+interfaces.IA.prototype.someFunction = function() {
+};
+interfaces.IA.prototype.someOtherFunction = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IA.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'someFunction': { type: 'B', declaredBy: 'interfaces.IA'},
+ 'someOtherFunction': { type: 'IB', declaredBy: 'interfaces.IA'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ public interface IB {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB_result.js
new file mode 100644
index 0000000..01a7fe6
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IB_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IB.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ };
+ }
+ };
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC.as b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC.as
new file mode 100644
index 0000000..3a650c7
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ public interface IC {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC_result.js b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC_result.js
new file mode 100644
index 0000000..f9b77c6
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/bad_overrides/interfaces/IC_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IC');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}]};
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IC.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/Test.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/Test.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/Test.as
new file mode 100644
index 0000000..9190d6e
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/Test.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+ import classes.A;
+ import classes.C;
+ import interfaces.IC;
+
+ public class Test extends A
+ {
+ public function Test()
+ {
+ super();
+ }
+
+ override public function someFunction():C
+ {
+ return null;
+ }
+
+ override public function someOtherFunction():IC
+ {
+ return null;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/Test_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/Test_result.js
new file mode 100644
index 0000000..8f8fd20
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/Test_result.js
@@ -0,0 +1,94 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ */
+Test = function() {
+ Test.base(this, 'constructor');
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someFunction = function() {
+ return null;
+};
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someOtherFunction = function() {
+ return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Test', Test);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Test.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'Test': { type: '', declaredBy: 'Test'},
+ 'someFunction': { type: 'C', declaredBy: 'Test'},
+ 'someOtherFunction': { type: 'IC', declaredBy: 'Test'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A.as
new file mode 100644
index 0000000..004a607
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ import interfaces.IA;
+ import interfaces.IB;
+
+ public class A implements IA
+ {
+ public function A()
+ {
+ }
+
+ public function someFunction():B
+ {
+ return null;
+ }
+
+ public function someOtherFunction():IB
+ {
+ return null;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A_result.js
new file mode 100644
index 0000000..e3320af
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/A_result.js
@@ -0,0 +1,92 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.A');
+
+goog.require('interfaces.IA');
+
+
+
+/**
+ * @constructor
+ * @implements {interfaces.IA}
+ */
+classes.A = function() {
+};
+
+
+/**
+ * @export
+ * @return {classes.B}
+ */
+classes.A.prototype.someFunction = function() {
+ return null;
+};
+
+
+/**
+ * @export
+ * @return {interfaces.IB}
+ */
+classes.A.prototype.someOtherFunction = function() {
+ return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}], interfaces: [interfaces.IA] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.A', classes.A);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.A.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'A': { type: '', declaredBy: 'classes.A'},
+ 'someFunction': { type: 'B', declaredBy: 'classes.A'},
+ 'someOtherFunction': { type: 'IB', declaredBy: 'classes.A'}
+ };
+ }
+ };
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ public class B
+ {
+ public function B() {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B_result.js
new file mode 100644
index 0000000..8aaa2f7
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/B_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.B', classes.B);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.B.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'B': { type: '', declaredBy: 'classes.B'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C.as
new file mode 100644
index 0000000..e2e4c8f
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package classes
+{
+ public class C extends B
+ {
+ public function C() {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C_result.js
new file mode 100644
index 0000000..208d51c
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/classes/C_result.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.C');
+
+goog.require('classes.B');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.B}
+ */
+classes.C = function() {
+ classes.C.base(this, 'constructor');
+};
+goog.inherits(classes.C, classes.B);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.C', classes.C);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.C.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'C': { type: '', declaredBy: 'classes.C'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA.as
new file mode 100644
index 0000000..6f363bc
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ import classes.B;
+
+ public interface IA
+ {
+ function someFunction():B;
+ function someOtherFunction():IB;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA_result.js
new file mode 100644
index 0000000..04220e1
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IA_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IA');
+
+
+
+
+/**
+ * @interface
+ */
+interfaces.IA = function() {
+};
+interfaces.IA.prototype.someFunction = function() {
+};
+interfaces.IA.prototype.someOtherFunction = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IA.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ 'someFunction': { type: 'B', declaredBy: 'interfaces.IA'},
+ 'someOtherFunction': { type: 'IB', declaredBy: 'interfaces.IA'}
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ public interface IB {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB_result.js
new file mode 100644
index 0000000..01a7fe6
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IB_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IB.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ };
+ }
+ };
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC.as b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC.as
new file mode 100644
index 0000000..b2440bf
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+ public interface IC extends IB {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC_result.js b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC_result.js
new file mode 100644
index 0000000..1af780a
--- /dev/null
+++ b/compiler.jx.tests/test-files/flexjs/projects/overrides/interfaces/IC_result.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IC');
+
+goog.require('interfaces.IB');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.IB}
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}], interfaces: [interfaces.IB] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IC.prototype.FLEXJS_REFLECTION_INFO = function () {
+ return {
+ variables: function () {
+ return {
+ };
+ },
+ accessors: function () {
+ return {
+ };
+ },
+ methods: function () {
+ return {
+ };
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index bcae9ef..67657f7 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -26,6 +26,7 @@ import java.util.Set;
import org.apache.flex.compiler.common.DependencyType;
import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitterTokens;
import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
@@ -260,4 +261,13 @@ public class FlexJSProject extends FlexProject
}
}
+ @Override
+ public boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition)
+ {
+ if (baseDefinition == overrideDefinition)
+ return true;
+ if (overrideDefinition.isInstanceOf(baseDefinition.getQualifiedName(), this))
+ return true;
+ return false;
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler/src/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java b/compiler/src/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java
index db64fee..7a59d80 100644
--- a/compiler/src/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java
+++ b/compiler/src/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java
@@ -455,7 +455,7 @@ public class FunctionDefinition extends ScopedDefinitionBase implements IFunctio
// Compare return types.
ITypeDefinition returnType1 = resolveReturnType(project);
ITypeDefinition returnType2 = other.resolveReturnType(project);
- if (returnType1 != returnType2)
+ if (!project.isCompatibleOverrideReturnType(returnType1, returnType2))
return false;
// Compare parameters.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java b/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
index 4914cc6..bf00fa8 100644
--- a/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
+++ b/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
@@ -996,4 +996,9 @@ public abstract class CompilerProject implements ICompilerProject
{
this.problems = problems;
}
+
+ public boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition)
+ {
+ return (baseDefinition == overrideDefinition);
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bc9edf35/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java b/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
index 2610c01..d4ef3ef 100644
--- a/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
+++ b/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
@@ -222,4 +222,11 @@ public interface ICompilerProject
* can add a problem if they don't have another place to add them.
*/
void setProblems(Collection<ICompilerProblem> problems);
+
+ /**
+ * @param overrideDefinition The definition overriding the base definition.
+ * @param baseDefinition The definition being overridden.
+ * @return True if compatible (default is if they are the same)
+ */
+ boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition);
}
[4/5] git commit: [flex-falcon] [refs/heads/develop] - add
-compiler.allow-subclass-overrides option to build 'extern' swcs
Posted by ah...@apache.org.
add -compiler.allow-subclass-overrides option to build 'extern' swcs
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/69eb3d52
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/69eb3d52
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/69eb3d52
Branch: refs/heads/develop
Commit: 69eb3d52e6d592b4763d9ded7f65c08f9abef0ea
Parents: 0d5b35f
Author: Alex Harui <ah...@apache.org>
Authored: Mon Mar 21 08:18:12 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 21 21:01:45 2016 -0700
----------------------------------------------------------------------
.../codegen/js/flexjs/TestFlexJSProject.java | 18 ++++++++++++++++++
.../codegen/js/jx/MemberAccessEmitter.java | 5 -----
.../compiler/internal/projects/FlexJSProject.java | 12 ------------
.../src/org/apache/flex/compiler/clients/ASC.java | 9 ++++++++-
.../flex/compiler/config/Configuration.java | 18 ++++++++++++++++++
.../compiler/internal/config/TargetSettings.java | 6 ++++++
.../compiler/internal/projects/FlexProject.java | 13 +++++++++++++
.../flex/compiler/targets/ITargetSettings.java | 6 ++++++
8 files changed, 69 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/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 feba941..7a739c1 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
@@ -28,7 +28,9 @@ import java.util.Collection;
import java.util.List;
import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogProject;
+import org.apache.flex.compiler.internal.config.TargetSettings;
import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
@@ -132,6 +134,14 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "Test";
+ try {
+ ((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
+ } catch (ConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
+
sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
projectDirPath + "/overrides").getPath();
@@ -148,6 +158,14 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "Test";
+ try {
+ ((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
+ } catch (ConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
+
sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
projectDirPath + "/bad_overrides").getPath();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index 305b2e9..0421a5c 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -64,11 +64,6 @@ public class MemberAccessEmitter extends JSSubEmitter implements
IASNode leftNode = node.getLeftOperandNode();
IASNode rightNode = node.getRightOperandNode();
- String leftName = "";
- if (leftNode instanceof IdentifierNode)
- {
- leftName = ((IdentifierNode)leftNode).getName();
- }
JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter();
IDefinition def = node.resolve(getProject());
if (def == null)
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index 15cf7ab..a1098a7 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -26,7 +26,6 @@ import java.util.Set;
import org.apache.flex.compiler.common.DependencyType;
import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitterTokens;
import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
@@ -260,15 +259,4 @@ public class FlexJSProject extends FlexProject
e.printStackTrace();
}
}
-
- @Override
- public boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition)
- {
- if (baseDefinition == overrideDefinition)
- return true;
- if (overrideDefinition != null && baseDefinition != null &&
- overrideDefinition.isInstanceOf(baseDefinition.getQualifiedName(), this))
- return true;
- return false;
- }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler/src/org/apache/flex/compiler/clients/ASC.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/clients/ASC.java b/compiler/src/org/apache/flex/compiler/clients/ASC.java
index 3befd95..432a445 100644
--- a/compiler/src/org/apache/flex/compiler/clients/ASC.java
+++ b/compiler/src/org/apache/flex/compiler/clients/ASC.java
@@ -447,7 +447,14 @@ public class ASC
@Override
public boolean getMxmlChildrenAsData()
{
- // Not used because ASC does not create SWCs.
+ // Not used because ASC does handle MXML.
+ return false;
+ }
+
+ @Override
+ public boolean getAllowSubclassOverrides()
+ {
+ // Not used because ASC is not used in cross-compiling.
return false;
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler/src/org/apache/flex/compiler/config/Configuration.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/config/Configuration.java b/compiler/src/org/apache/flex/compiler/config/Configuration.java
index ae20994..6516464 100644
--- a/compiler/src/org/apache/flex/compiler/config/Configuration.java
+++ b/compiler/src/org/apache/flex/compiler/config/Configuration.java
@@ -2324,6 +2324,24 @@ public class Configuration
}
//
+ // 'compiler.allow-subclass-overrides' option
+ //
+ private Boolean allowSubclassOverrides = false;
+
+ public Boolean getCompilerAllowSubclassOverrides()
+ {
+ return allowSubclassOverrides;
+ }
+
+ @Config
+ @Mapping({ "compiler", "allow-subclass-override" })
+ @FlexOnly
+ public void setCompilerAllowSubclassOverrides(ConfigurationValue cv, Boolean allow) throws ConfigurationException
+ {
+ allowSubclassOverrides = allow;
+ }
+
+ //
// 'compiler.mxml.implicitImports' option
//
private String[] implicitImports;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler/src/org/apache/flex/compiler/internal/config/TargetSettings.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/config/TargetSettings.java b/compiler/src/org/apache/flex/compiler/internal/config/TargetSettings.java
index 0d84e88..03ba470 100644
--- a/compiler/src/org/apache/flex/compiler/internal/config/TargetSettings.java
+++ b/compiler/src/org/apache/flex/compiler/internal/config/TargetSettings.java
@@ -569,6 +569,12 @@ public class TargetSettings implements ITargetSettings
}
@Override
+ public boolean getAllowSubclassOverrides()
+ {
+ return configuration.getCompilerMxmlChildrenAsData();
+ }
+
+ @Override
public boolean getRemoveDeadCode()
{
return configuration.getRemoveDeadCode();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
index 9180fe1..6b44dd2 100644
--- a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
+++ b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
@@ -49,6 +49,7 @@ import org.apache.flex.compiler.definitions.INamespaceDefinition;
import org.apache.flex.compiler.definitions.IScopedDefinition;
import org.apache.flex.compiler.definitions.ISetterDefinition;
import org.apache.flex.compiler.definitions.IStyleDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.definitions.IVariableDefinition;
import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference;
@@ -2170,4 +2171,16 @@ public class FlexProject extends ASProject implements IFlexProject
{
return this.strictXML = strictXML;
}
+
+ @Override
+ public boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition)
+ {
+ if (baseDefinition == overrideDefinition)
+ return true;
+ if (targetSettings != null && targetSettings.getAllowSubclassOverrides() && overrideDefinition != null && baseDefinition != null &&
+ overrideDefinition.isInstanceOf(baseDefinition.getQualifiedName(), this))
+ return true;
+ return false;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/69eb3d52/compiler/src/org/apache/flex/compiler/targets/ITargetSettings.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/targets/ITargetSettings.java b/compiler/src/org/apache/flex/compiler/targets/ITargetSettings.java
index 7300b02..f223f50 100644
--- a/compiler/src/org/apache/flex/compiler/targets/ITargetSettings.java
+++ b/compiler/src/org/apache/flex/compiler/targets/ITargetSettings.java
@@ -465,6 +465,12 @@ public interface ITargetSettings
boolean getMxmlChildrenAsData();
/**
+ * @return true if the return type of an override can be a subclass instead
+ * of an exact match as the base class' return type
+ */
+ boolean getAllowSubclassOverrides();
+
+ /**
* @return true if the dead code filtering optimization step is enabled.
*/
boolean getRemoveDeadCode();
[5/5] git commit: [flex-falcon] [refs/heads/develop] - get compiler
to redirect Array.sortOn
Posted by ah...@apache.org.
get compiler to redirect Array.sortOn
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/e736a120
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/e736a120
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/e736a120
Branch: refs/heads/develop
Commit: e736a1209ae642903da24182975f27ca272bf34b
Parents: 69eb3d5
Author: Alex Harui <ah...@apache.org>
Authored: Mon Mar 21 12:14:40 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 21 21:01:45 2016 -0700
----------------------------------------------------------------------
.../js/flexjs/TestFlexJSGlobalClasses.java | 18 +++++++++++++++
.../codegen/js/jx/FunctionCallEmitter.java | 23 ++++++++++++++++++++
externs/js/missing.js | 6 +++++
3 files changed, 47 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e736a120/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 96a9a0a..df663af 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
@@ -141,6 +141,24 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
}
@Test
+ public void testArraySortOn()
+ {
+ IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.sortOn('foo')");
+ IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+ asBlockWalker.visitFunctionCall(parentNode);
+ assertOut("org.apache.flex.utils.Language.sortOn(a, 'foo')");
+ }
+
+ @Test
+ public void testArraySortOnTwoArgs()
+ {
+ IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.sortOn('foo', 10)");
+ IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+ asBlockWalker.visitFunctionCall(parentNode);
+ assertOut("org.apache.flex.utils.Language.sortOn(a, 'foo', 10)");
+ }
+
+ @Test
public void testIntConstMaxValue()
{
IVariableNode node = getVariable("var a:Number = int.MAX_VALUE");
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e736a120/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
index c38d820..475541e 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -33,6 +33,9 @@ import org.apache.flex.compiler.internal.definitions.ClassDefinition;
import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.compiler.internal.tree.as.ContainerNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.NumericLiteralNode;
import org.apache.flex.compiler.internal.tree.as.VectorLiteralNode;
import org.apache.flex.compiler.projects.ICompilerProject;
import org.apache.flex.compiler.tree.ASTNodeID;
@@ -139,6 +142,26 @@ public class FunctionCallEmitter extends JSSubEmitter implements ISubEmitter<IFu
if (isInt)
write(JSFlexJSEmitterTokens.UNDERSCORE);
}
+ else if (def != null && def.getBaseName().equals("sortOn"))
+ {
+ if (def.getParent() != null &&
+ def.getParent().getQualifiedName().equals("Array"))
+ {
+ ICompilerProject project = this.getProject();
+ if (project instanceof FlexJSProject)
+ ((FlexJSProject) project).needLanguage = true;
+ write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("sortOn");
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(((IdentifierNode)cnode).getName()); // will this always be an indentifer node
+ writeToken(ASEmitterTokens.COMMA);
+ fjs.walkArguments(node.getArgumentNodes());
+ write(ASEmitterTokens.PAREN_CLOSE);
+ return;
+ }
+ }
+
else if (def instanceof AppliedVectorDefinition)
{
fjs.walkArguments(node.getArgumentNodes());
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e736a120/externs/js/missing.js
----------------------------------------------------------------------
diff --git a/externs/js/missing.js b/externs/js/missing.js
index aedd69f..d3e6d3c 100644
--- a/externs/js/missing.js
+++ b/externs/js/missing.js
@@ -217,6 +217,12 @@ Array.prototype.insertAt = function(index, element) {};
*/
Array.prototype.removeAt = function(index) {};
+/**
+ * @param {Object} fieldName The field name or array of field names.
+ * @param {Object=} opt_options The bitmask of options.
+ * @return {Array} The sorted Array.
+ */
+Array.prototype.sortOn = function(fieldName, opt_options) {};
/**
[3/5] git commit: [flex-falcon] [refs/heads/develop] - handle null
Posted by ah...@apache.org.
handle null
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/0d5b35f0
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/0d5b35f0
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/0d5b35f0
Branch: refs/heads/develop
Commit: 0d5b35f018da4c85b3e7361ae1686f53ff03ab6e
Parents: 0d4d871
Author: Alex Harui <ah...@apache.org>
Authored: Sun Mar 20 22:19:23 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 21 21:01:45 2016 -0700
----------------------------------------------------------------------
.../org/apache/flex/compiler/internal/projects/FlexJSProject.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/0d5b35f0/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index 67657f7..15cf7ab 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -266,7 +266,8 @@ public class FlexJSProject extends FlexProject
{
if (baseDefinition == overrideDefinition)
return true;
- if (overrideDefinition.isInstanceOf(baseDefinition.getQualifiedName(), this))
+ if (overrideDefinition != null && baseDefinition != null &&
+ overrideDefinition.isInstanceOf(baseDefinition.getQualifiedName(), this))
return true;
return false;
}