make sure we handle simple allowed circular references
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/74fdfbfd Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/74fdfbfd Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/74fdfbfd Branch: refs/heads/develop Commit: 74fdfbfd5e7c64a742d9888b6572187ee49de59c Parents: e39393a Author: Alex Harui <[email protected]> Authored: Mon Nov 30 16:05:08 2015 -0800 Committer: Alex Harui <[email protected]> Committed: Mon Nov 30 16:05:08 2015 -0800 ---------------------------------------------------------------------- .../codegen/js/flexjs/TestFlexJSProject.java | 15 +++++++ .../test-files/flexjs/projects/circular/Base.as | 30 +++++++++++++ .../flexjs/projects/circular/Base_result.js | 43 ++++++++++++++++++ .../flexjs/projects/circular/Super.as | 27 +++++++++++ .../flexjs/projects/circular/Super_result.js | 47 ++++++++++++++++++++ 5 files changed, 162 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74fdfbfd/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 faac533..dcc3c56 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 @@ -93,6 +93,21 @@ public class TestFlexJSProject extends TestGoogProject } @Test + public void test_IsItCircular() + { + String testDirPath = projectDirPath + "/circular"; + + String fileName = "Base"; + + sourcePath = "test-files" + + File.separator + projectDirPath + "/circular"; + + List<String> compiledFileNames = compileProject(fileName, testDirPath); + + assertProjectOut(compiledFileNames, testDirPath); + } + + @Test public void test_PackageConflict_AmbiguousDefinition() { String testDirPath = projectDirPath + "/package_conflicts_ambiguous_definition"; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74fdfbfd/compiler.jx.tests/test-files/flexjs/projects/circular/Base.as ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/test-files/flexjs/projects/circular/Base.as b/compiler.jx.tests/test-files/flexjs/projects/circular/Base.as new file mode 100644 index 0000000..64798d8 --- /dev/null +++ b/compiler.jx.tests/test-files/flexjs/projects/circular/Base.as @@ -0,0 +1,30 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 Super; + + public class Base extends Super + { + public function Base() + { + super(); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74fdfbfd/compiler.jx.tests/test-files/flexjs/projects/circular/Base_result.js ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/test-files/flexjs/projects/circular/Base_result.js b/compiler.jx.tests/test-files/flexjs/projects/circular/Base_result.js new file mode 100644 index 0000000..fac69d9 --- /dev/null +++ b/compiler.jx.tests/test-files/flexjs/projects/circular/Base_result.js @@ -0,0 +1,43 @@ +/** + * 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. + */ +/** + * Base + * + * @fileoverview + * + * @suppress {checkTypes|accessControls} + */ + +goog.provide('Base'); + +goog.require('Super'); + + + +/** + * @constructor + * @extends {Super} + */ +Base = function() { + Base.base(this, 'constructor'); +}; +goog.inherits(Base, Super); + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74fdfbfd/compiler.jx.tests/test-files/flexjs/projects/circular/Super.as ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/test-files/flexjs/projects/circular/Super.as b/compiler.jx.tests/test-files/flexjs/projects/circular/Super.as new file mode 100644 index 0000000..d72a859 --- /dev/null +++ b/compiler.jx.tests/test-files/flexjs/projects/circular/Super.as @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 Super + { + public function Super() {} + + private static var isItCircular:Base; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74fdfbfd/compiler.jx.tests/test-files/flexjs/projects/circular/Super_result.js ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/test-files/flexjs/projects/circular/Super_result.js b/compiler.jx.tests/test-files/flexjs/projects/circular/Super_result.js new file mode 100644 index 0000000..64afaa2 --- /dev/null +++ b/compiler.jx.tests/test-files/flexjs/projects/circular/Super_result.js @@ -0,0 +1,47 @@ +/** + * 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. + */ +/** + * Super + * + * @fileoverview + * + * @suppress {checkTypes|accessControls} + */ + +goog.provide('Super'); + +goog.require('Base'); + + + +/** + * @constructor + */ +Super = function() { +}; + + +/** + * @private + * @type {Base} + */ +Super.isItCircular; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +Super.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Super', qName: 'Super'}] };
