Repository: flex-falcon Updated Branches: refs/heads/develop 65ef0d9a5 -> 51ddb8580
add test for this circular scenario Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/51ddb858 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/51ddb858 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/51ddb858 Branch: refs/heads/develop Commit: 51ddb8580e867c2d2a21d7aebe386a279e72c6f4 Parents: 65ef0d9 Author: Alex Harui <aha...@apache.org> Authored: Tue Mar 14 23:29:57 2017 -0700 Committer: Alex Harui <aha...@apache.org> Committed: Tue Mar 14 23:29:57 2017 -0700 ---------------------------------------------------------------------- .../codegen/js/flexjs/TestFlexJSProject.java | 17 +++++ .../codegen/js/goog/TestGoogProject.java | 35 +++++++++ .../flex/compiler/internal/test/TestBase.java | 49 ++++++++++++ .../org/apache/flex/utils/EnvProperties.java | 8 ++ .../flexjs/projects/circular_proto/A.as | 35 +++++++++ .../flexjs/projects/circular_proto/A_result.js | 74 ++++++++++++++++++ .../flexjs/projects/circular_proto/B.as | 39 ++++++++++ .../flexjs/projects/circular_proto/B_result.js | 78 +++++++++++++++++++ .../flexjs/projects/circular_proto/C.as | 38 ++++++++++ .../flexjs/projects/circular_proto/C_result.js | 80 ++++++++++++++++++++ .../flexjs/projects/circular_proto/D.as | 37 +++++++++ .../flexjs/projects/circular_proto/D_result.js | 80 ++++++++++++++++++++ .../flexjs/projects/circular_proto/E.as | 38 ++++++++++ .../flexjs/projects/circular_proto/E_result.js | 76 +++++++++++++++++++ .../flexjs/projects/circular_proto/F.as | 36 +++++++++ .../flexjs/projects/circular_proto/F_result.js | 80 ++++++++++++++++++++ .../projects/circular_proto/index_result.html | 42 ++++++++++ 17 files changed, 842 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java index dbdb67c..fa184b9 100644 --- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java +++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java @@ -131,6 +131,23 @@ public class TestFlexJSProject extends TestGoogProject } @Test + public void test_IsItCircularProto() + { + String testDirPath = projectDirPath + "/circular_proto"; + + String fileName = "A.as"; + + sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), + projectDirPath + "/circular_proto").getPath(); + + int exitCode = compileAndPublishProject(testDirPath, "circular_proto", fileName); + + assertThat(exitCode, is(0)); + + assertPublishedProjectOut(testDirPath, "circular_proto"); + } + + @Test public void test_XMLRequires() { String testDirPath = projectDirPath + "/xml_requires"; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java index f9be0d7..6d70fa0 100644 --- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java +++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java @@ -19,6 +19,10 @@ package org.apache.flex.compiler.internal.codegen.js.goog; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.FileFileFilter; +import org.apache.commons.io.filefilter.FileFilterUtils; +import org.apache.commons.io.filefilter.IOFileFilter; import org.apache.flex.compiler.driver.IBackend; import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend; import org.apache.flex.compiler.internal.test.ASTestBase; @@ -26,6 +30,7 @@ import org.apache.flex.utils.TestAdapterFactory; import org.junit.Test; import java.io.File; +import java.util.Collection; import java.util.List; import static org.hamcrest.core.Is.is; @@ -98,4 +103,34 @@ public class TestGoogProject extends ASTestBase } } + protected void assertPublishedProjectOut(String projectFolderPath, + String projectName) + { + String outputFolderName = tempDir + "/" + projectName + "/bin/js-debug"; + IOFileFilter jsFilter = FileFilterUtils.and(FileFileFilter.FILE, + FileFilterUtils.suffixFileFilter("js")); + IOFileFilter htmlFilter = FileFilterUtils.and(FileFileFilter.FILE, + FileFilterUtils.suffixFileFilter("html")); + IOFileFilter resultsFilter = FileFilterUtils.or(jsFilter, htmlFilter); + File outputFolder = new File(outputFolderName); + File projectFolder = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), projectFolderPath); + projectFolderPath = projectFolder.getAbsolutePath(); + Collection<File> files = FileUtils.listFiles(projectFolder, resultsFilter, null); + for (File resultFile : files) + { + String compiledFilePath = resultFile.getAbsolutePath(); + if (compiledFilePath.startsWith(projectFolderPath)) + compiledFilePath = compiledFilePath.substring(projectFolderPath.length()); + compiledFilePath = compiledFilePath.replace("_result", ""); + File compiledFile = new File(outputFolder, compiledFilePath); + String compiledResult = readCodeFile(compiledFile); + + String expectedResult = readCodeFile(resultFile); + /*if (!compiledResult.equals(expectedResult)) { + System.out.println("expected\n"+expectedResult); + System.out.println("got\n"+compiledResult); + }*/ + assertThat(compiledResult, is(expectedResult)); + } + } } http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java index ab18cbd..fce0907 100644 --- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java +++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java @@ -27,6 +27,7 @@ import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; +import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; @@ -37,6 +38,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.FileFileFilter; +import org.apache.commons.io.filefilter.FileFilterUtils; +import org.apache.commons.io.filefilter.IOFileFilter; +import org.apache.flex.compiler.clients.MXMLJSC; import org.apache.flex.compiler.codegen.as.IASEmitter; import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter; import org.apache.flex.compiler.config.Configurator; @@ -743,6 +749,20 @@ public class TestBase implements ITestBase } } } + else if (line.contains("<!--") && isResult) + { + // eat opening comment which should be apache header + while (line != null) + { + line = in.readLine(); + if (line.contains("-->")) + { + line = in.readLine(); + break; + } + } + } + while (line != null) { code += line + "\n"; @@ -783,4 +803,33 @@ public class TestBase implements ITestBase return null; } + protected int compileAndPublishProject(String projectFolderPath, + String projectName, String mainFileName) + { + String sourceFolderName = tempDir + "/" + projectName + "/src"; + IOFileFilter asFilter = FileFilterUtils.and(FileFileFilter.FILE, + FileFilterUtils.suffixFileFilter(".as")); + File sourceFolder = new File(sourceFolderName); + File projectFolder = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), projectFolderPath); + try { + FileUtils.copyDirectory(projectFolder, sourceFolder, asFilter); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + int numArgs = 3; + if (env.GOOG != null) numArgs++; + String[] args = new String[numArgs]; + File mainFile = new File(sourceFolder, mainFileName); + //args[0] = "-compiler.targets=JS"; + int index = 0; + args[index++] = "-external-library-path=" + env.ASJS + "/js/libs/js.swc"; + args[index++] = "-remove-circulars"; + if (env.GOOG != null) + args[index++] = "-closure-lib=" + env.GOOG; + args[index++] = mainFile.getAbsolutePath(); + int exitCode = MXMLJSC.staticMainNoExit(args); + return exitCode; + } + } http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java b/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java index ea75057..ee2c3f3 100644 --- a/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java +++ b/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java @@ -70,6 +70,11 @@ public class EnvProperties { */ public String FPVER; + /** + * GOOG_HOME + */ + public String GOOG; + private static EnvProperties env; @@ -144,6 +149,9 @@ public class EnvProperties { if (ASJS == null) ASJS = FilenameNormalization.normalize("../../../../flex-asjs"); System.out.println("environment property - ASJS_HOME = " + ASJS); + + GOOG = p.getProperty(prefix + "GOOG_HOME", System.getenv("GOOG_HOME")); + } } http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A.as new file mode 100644 index 0000000..09c4156 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A.as @@ -0,0 +1,35 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + */ + public class A + { + public function A() + { + } + + private function test():void { + var bar:int = E.a(false); + } + + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A_result.js new file mode 100644 index 0000000..8fd88dd --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/A_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. + */ +/** + * Generated by Apache Flex Cross-Compiler from A.as + * A + * + * @fileoverview + * + * @suppress {checkTypes|accessControls} + */ + +goog.provide('A'); + +goog.require('E'); + + + +/** + * @constructor + */ +A = function() { +}; + + +/** + * @private + */ +A.prototype.test = function() { + var /** @type {number} */ bar = E.a(false); +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'A', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('A', A); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +A.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'A': { type: '', declaredBy: 'A'} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B.as new file mode 100644 index 0000000..fac9035 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B.as @@ -0,0 +1,39 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + * FlowComposerBase + */ + public class B + { + + public function B() + { + + } + + public static function a(b:Boolean):int{ + if (b) + return E.a(false); + return 0; + } + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B_result.js new file mode 100644 index 0000000..ff881d1 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/B_result.js @@ -0,0 +1,78 @@ +/** + * 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. + */ +/** + * Generated by Apache Flex Cross-Compiler from B.as + * B + * + * @fileoverview + * + * @suppress {missingRequire|checkTypes|accessControls} + */ + +goog.provide('B'); + + + + +/** + * @constructor + */ +B = function() { +}; + + +/** + * @export + * @param {boolean} b + * @return {number} + */ +B.a = function(b) { + if (b) + return E.a(false); + return 0; +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'B', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('B', B); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +B.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'B': { type: '', declaredBy: 'B'}, + '|a': { type: 'int', declaredBy: 'B', parameters: function () { return [ { index: 1, type: 'Boolean', optional: false } ]; }} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C.as new file mode 100644 index 0000000..f75cc04 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C.as @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + StandardFlowComposer extends FlowComposerBase + */ + public class C extends B + { + + public function C() + { + + } + + public static function a(b:Boolean):int{ + // FactoryComposer + return F.a(false); + } + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C_result.js new file mode 100644 index 0000000..9dece88 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/C_result.js @@ -0,0 +1,80 @@ +/** + * 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. + */ +/** + * Generated by Apache Flex Cross-Compiler from C.as + * C + * + * @fileoverview + * + * @suppress {missingRequire|checkTypes|accessControls} + */ + +goog.provide('C'); + +goog.require('B'); + + + +/** + * @constructor + * @extends {B} + */ +C = function() { + C.base(this, 'constructor'); +}; +goog.inherits(C, B); + + +/** + * @export + * @param {boolean} b + * @return {number} + */ +C.a = function(b) { + return F.a(false); +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'C', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('C', C); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +C.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'C': { type: '', declaredBy: 'C'}, + '|a': { type: 'int', declaredBy: 'C', parameters: function () { return [ { index: 1, type: 'Boolean', optional: false } ]; }} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D.as new file mode 100644 index 0000000..fd2f01e --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D.as @@ -0,0 +1,37 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + * FactoryComposer extends StandardFlowComposer + */ + public class D extends C + { + + public function D() + { + + } + + public static function a(b:Boolean):int { + return 0; + } + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D_result.js new file mode 100644 index 0000000..3dcbe6f --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/D_result.js @@ -0,0 +1,80 @@ +/** + * 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. + */ +/** + * Generated by Apache Flex Cross-Compiler from D.as + * D + * + * @fileoverview + * + * @suppress {checkTypes|accessControls} + */ + +goog.provide('D'); + +goog.require('C'); + + + +/** + * @constructor + * @extends {C} + */ +D = function() { + D.base(this, 'constructor'); +}; +goog.inherits(D, C); + + +/** + * @export + * @param {boolean} b + * @return {number} + */ +D.a = function(b) { + return 0; +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +D.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'D', qName: 'D', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('D', D); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +D.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'D': { type: '', declaredBy: 'D'}, + '|a': { type: 'int', declaredBy: 'D', parameters: function () { return [ { index: 1, type: 'Boolean', optional: false } ]; }} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E.as new file mode 100644 index 0000000..dfae20b --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E.as @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + * Configuration + */ + public class E + { + + public function E() + { + + } + + public static function a(b:Boolean):int { + // StandardFlowComposer + return C.a(false); + } + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E_result.js new file mode 100644 index 0000000..ccf81c0 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/E_result.js @@ -0,0 +1,76 @@ +/** + * 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. + */ +/** + * Generated by Apache Flex Cross-Compiler from E.as + * E + * + * @fileoverview + * + * @suppress {missingRequire|checkTypes|accessControls} + */ + +goog.provide('E'); + + + + +/** + * @constructor + */ +E = function() { +}; + + +/** + * @export + * @param {boolean} b + * @return {number} + */ +E.a = function(b) { + return C.a(false); +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +E.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'E', qName: 'E', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('E', E); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +E.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'E': { type: '', declaredBy: 'E'}, + '|a': { type: 'int', declaredBy: 'E', parameters: function () { return [ { index: 1, type: 'Boolean', optional: false } ]; }} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F.as b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F.as new file mode 100644 index 0000000..350cf84 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F.as @@ -0,0 +1,36 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + /** + */ + public class F extends D + { + + public function F() + { + + } + + public static function a(b:Boolean):int { + return D.a(false); + } + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F_result.js new file mode 100644 index 0000000..96d9530 --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/F_result.js @@ -0,0 +1,80 @@ +/** + * 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. + */ +/** + * Generated by Apache Flex Cross-Compiler from F.as + * F + * + * @fileoverview + * + * @suppress {checkTypes|accessControls} + */ + +goog.provide('F'); + +goog.require('D'); + + + +/** + * @constructor + * @extends {D} + */ +F = function() { + F.base(this, 'constructor'); +}; +goog.inherits(F, D); + + +/** + * @export + * @param {boolean} b + * @return {number} + */ +F.a = function(b) { + return D.a(false); +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +F.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'F', qName: 'F', kind: 'class' }] }; + + +/** + * Prevent renaming of class. Needed for reflection. + */ +goog.exportSymbol('F', F); + + + +/** + * Reflection + * + * @return {Object.<string, Function>} + */ +F.prototype.FLEXJS_REFLECTION_INFO = function () { + return { + variables: function () {return {};}, + accessors: function () {return {};}, + methods: function () { + return { + 'F': { type: '', declaredBy: 'F'}, + '|a': { type: 'int', declaredBy: 'F', parameters: function () { return [ { index: 1, type: 'Boolean', optional: false } ]; }} + }; + } + }; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/51ddb858/compiler-jx/src/test/resources/flexjs/projects/circular_proto/index_result.html ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular_proto/index_result.html b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/index_result.html new file mode 100644 index 0000000..80c7d8e --- /dev/null +++ b/compiler-jx/src/test/resources/flexjs/projects/circular_proto/index_result.html @@ -0,0 +1,42 @@ +<!-- + +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. + +--> +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link rel="stylesheet" type="text/css" href="A.css"> + <script type="text/javascript" src="./library/closure/goog/base.js"></script> + <script type="text/javascript"> +// generated by FalconJX +goog.addDependency('../../../A.js', ['A'], ['E']); +goog.addDependency('../../../E.js', ['E'], ['C']); +goog.addDependency('../../../F.js', ['F'], ['D']); +goog.addDependency('../../../D.js', ['D'], ['C']); +goog.addDependency('../../../C.js', ['C'], ['B', 'F']); +goog.addDependency('../../../B.js', ['B'], []); + goog.require("A"); + </script> +</head> +<body> + <script type="text/javascript"> + new A().start(); + </script> +</body> +</html> \ No newline at end of file