http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/input.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/input.as b/compiler-jx/src/test/resources/goog/files/input.as new file mode 100644 index 0000000..81a4de6 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/input.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 org.apache.flex +{ + +import flash.events.IEventDispatcher; + +import goog.events.EventTarget; + +public dynamic class A extends goog.events.EventTarget implements IEventDispatcher +{ + public static const MY_CLASS_CONST:String = "myClassConst"; + + public function A() + { + trace(typeof "a"); + } + + private var _a:ArgumentError = new ArgumentError(); + + public const MY_INSTANCE_CONST:String = "myInstanceConst"; +} +}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/output.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/output.js b/compiler-jx/src/test/resources/goog/files/output.js new file mode 100644 index 0000000..b046100 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/output.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. + */ +goog.provide('org.apache.flex.A'); + +goog.require('flash.events.IEventDispatcher'); +goog.require('goog.events.EventTarget'); + +/** + * @constructor + * @extends {goog.events.EventTarget} + * @implements {flash.events.IEventDispatcher} + */ +org.apache.flex.A = function() { + var self = this; + org.apache.flex.A.base(this, 'constructor'); + self.trace(typeof("a")); +}; +goog.inherits(org.apache.flex.A, goog.events.EventTarget); + +/** + * @const + * @type {string} + */ +org.apache.flex.A.MY_CLASS_CONST = "myClassConst"; + +/** + * @private + * @type {ArgumentError} + */ +org.apache.flex.A.prototype._a = new ArgumentError(); + +/** + * @const + * @type {string} + */ +org.apache.flex.A.prototype.MY_INSTANCE_CONST = "myInstanceConst"; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/poc.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/poc.as b/compiler-jx/src/test/resources/goog/files/poc.as new file mode 100644 index 0000000..38ba0df --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/poc.as @@ -0,0 +1,107 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 flash.events.MouseEvent; + +import goog.events.BrowserEvent; +import goog.events.Event; +import goog.events.EventTarget; + +public class Example extends EventTarget +{ + private static const BYEBYE:String = "Bye Bye"; + private static const HELLOWORLD:String = "Hello World"; + + private static var counter:int = 100; + + public function Example() + { + init(); + } + + private var _btn1:Event; + private var _btn2:Event; + private var _btn3:Event; + private var _lbl1:BrowserEvent; + private var _lbl2:BrowserEvent; + private var _et1:EventTarget; + private var _et2:EventTarget; + private var _et3:EventTarget; + + public function init():void + { + _et1 = new EventTarget(); + _et2 = new EventTarget(); + _et3 = new EventTarget(); + + _lbl1 = new BrowserEvent(); + _lbl1.clientX = 100; + _lbl1.clientY = 25; + _lbl1.type = Example.HELLOWORLD; + + dispatchEvent(_lbl1); + + _lbl2 = new BrowserEvent(); + _lbl2.clientX = 200; + _lbl2.clientY = 25; + _lbl2.type = Example.counter + ""; + + dispatchEvent(_lbl2); + + _btn1 = new Event(); + _btn1.type = "Click me"; + _et1.addEventListener(MouseEvent.CLICK, btn1clickHandler); + + _et1.dispatchEvent(_btn1); + + _btn2 = new Event(); + _btn2.type = "Add it"; + _et2.addEventListener(MouseEvent.CLICK, btn2clickHandler); + + _et2.dispatchEvent(_btn2); + + _btn3 = new Event(); + _btn3.type = "Move it"; + _et3.addEventListener(MouseEvent.CLICK, btn3clickHandler); + + _et3.dispatchEvent(_btn3); + } + + protected function btn1clickHandler(event:MouseEvent):void + { + if (_lbl1.type == Example.HELLOWORLD) + _lbl1.type = Example.BYEBYE; + else + _lbl1.type = Example.HELLOWORLD; + } + + protected function btn2clickHandler(event:MouseEvent):void + { + _lbl2.type = --Example.counter + ""; + } + + protected function btn3clickHandler(event:MouseEvent):void + { + _lbl2.clientX += 10; + } + +} +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/poc_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/poc_result.js b/compiler-jx/src/test/resources/goog/files/poc_result.js new file mode 100644 index 0000000..a7e0f28 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/poc_result.js @@ -0,0 +1,154 @@ +/** + * 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. + */ +goog.provide('Example'); + +goog.require('flash.events.MouseEvent'); +goog.require('goog.events.BrowserEvent'); +goog.require('goog.events.Event'); +goog.require('goog.events.EventTarget'); + +/** + * @constructor + * @extends {goog.events.EventTarget} + */ +Example = function() { + var self = this; + Example.base(this, 'constructor'); + self.init(); +}; +goog.inherits(Example, goog.events.EventTarget); + +/** + * @private + * @const + * @type {string} + */ +Example.BYEBYE = "Bye Bye"; + +/** + * @private + * @const + * @type {string} + */ +Example.HELLOWORLD = "Hello World"; + +/** + * @private + * @type {number} + */ +Example.counter = 100; + +/** + * @private + * @type {goog.events.Event} + */ +Example.prototype._btn1; + +/** + * @private + * @type {goog.events.Event} + */ +Example.prototype._btn2; + +/** + * @private + * @type {goog.events.Event} + */ +Example.prototype._btn3; + +/** + * @private + * @type {goog.events.BrowserEvent} + */ +Example.prototype._lbl1; + +/** + * @private + * @type {goog.events.BrowserEvent} + */ +Example.prototype._lbl2; + +/** + * @private + * @type {goog.events.EventTarget} + */ +Example.prototype._et1; + +/** + * @private + * @type {goog.events.EventTarget} + */ +Example.prototype._et2; + +/** + * @private + * @type {goog.events.EventTarget} + */ +Example.prototype._et3; + +Example.prototype.init = function() { + var self = this; + self._et1 = new goog.events.EventTarget(); + self._et2 = new goog.events.EventTarget(); + self._et3 = new goog.events.EventTarget(); + self._lbl1 = new goog.events.BrowserEvent(); + self._lbl1.clientX = 100; + self._lbl1.clientY = 25; + self._lbl1.type = Example.HELLOWORLD; + self.dispatchEvent(self._lbl1); + self._lbl2 = new goog.events.BrowserEvent(); + self._lbl2.clientX = 200; + self._lbl2.clientY = 25; + self._lbl2.type = Example.counter + ""; + self.dispatchEvent(self._lbl2); + self._btn1 = new goog.events.Event(); + self._btn1.type = "Click me"; + self._et1.addEventListener(flash.events.MouseEvent.CLICK, self.btn1clickHandler); + self._et1.dispatchEvent(self._btn1); + self._btn2 = new goog.events.Event(); + self._btn2.type = "Add it"; + self._et2.addEventListener(flash.events.MouseEvent.CLICK, self.btn2clickHandler); + self._et2.dispatchEvent(self._btn2); + self._btn3 = new goog.events.Event(); + self._btn3.type = "Move it"; + self._et3.addEventListener(flash.events.MouseEvent.CLICK, self.btn3clickHandler); + self._et3.dispatchEvent(self._btn3); +}; + +/** + * @param {flash.events.MouseEvent} event + */ +Example.prototype.btn1clickHandler = function(event) { + var self = this; + if (self._lbl1.type == Example.HELLOWORLD) + self._lbl1.type = Example.BYEBYE; + else + self._lbl1.type = Example.HELLOWORLD; +}; + +/** + * @param {flash.events.MouseEvent} event + */ +Example.prototype.btn2clickHandler = function(event) { + var self = this; + self._lbl2.type = --Example.counter + ""; +}; + +/** + * @param {flash.events.MouseEvent} event + */ +Example.prototype.btn3clickHandler = function(event) { + var self = this; + self._lbl2.clientX += 10; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/qualify-new-object.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/qualify-new-object.as b/compiler-jx/src/test/resources/goog/files/qualify-new-object.as new file mode 100644 index 0000000..d9e6a10 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/qualify-new-object.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 org.apache.flex +{ + +import flash.events.EventDispatcher; + +import goog.events.EventTarget; + +public class A extends EventDispatcher +{ + public function A() + { + init(); + } + + private var _privateVar:EventTarget; + + public function init():void + { + var btn:EventTarget = new EventTarget(); + + _privateVar = new EventTarget(); + + addEventListener("click", function () {}); + } + + public function start():void + { + var localVar:String = _privateVar.label; + init(); + doIt(); + } +} +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js b/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js new file mode 100644 index 0000000..1ba905f --- /dev/null +++ b/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js @@ -0,0 +1,49 @@ +/** + * 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. + */ +goog.provide('org.apache.flex.A'); + +goog.require('flash.events.EventDispatcher'); +goog.require('goog.events.EventTarget'); + +/** + * @constructor + * @extends {flash.events.EventDispatcher} + */ +org.apache.flex.A = function() { + var self = this; + org.apache.flex.A.base(this, 'constructor'); + self.init(); +}; +goog.inherits(org.apache.flex.A, flash.events.EventDispatcher); + +/** + * @private + * @type {goog.events.EventTarget} + */ +org.apache.flex.A.prototype._privateVar; + +org.apache.flex.A.prototype.init = function() { + var self = this; + var /** @type {goog.events.EventTarget} */ btn = new goog.events.EventTarget(); + self._privateVar = new goog.events.EventTarget(); + self.addEventListener("click", function() { + }); +}; + +org.apache.flex.A.prototype.start = function() { + var self = this; + var /** @type {string} */ localVar = self._privateVar.label; + self.init(); + doIt(); +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/Case.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/Case.as b/compiler-jx/src/test/resources/goog/projects/imports/Case.as new file mode 100644 index 0000000..1922d4d --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/Case.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 comps.A; + + public class Case + { + public function Case() + { + var bar:A = new A(); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js b/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js new file mode 100644 index 0000000..2d090e9 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js @@ -0,0 +1,24 @@ +/** + * 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. + */ +goog.provide('Case'); + +goog.require('comps.A'); + +/** + * @constructor + */ +Case = function() { + var self = this; + var /** @type {comps.A} */ bar = new comps.A(); +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as b/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as new file mode 100644 index 0000000..e8f39c4 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/A.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 comps +{ + public class A + { + public function A() + { + var foo:B = new B(); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js b/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js new file mode 100644 index 0000000..5d128a5 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js @@ -0,0 +1,22 @@ +/** + * 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. + */ +goog.provide('comps.A'); + +/** + * @constructor + */ +comps.A = function() { + var self = this; + var /** @type {comps.B} */ foo = new B(); +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as b/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as new file mode 100644 index 0000000..551b279 --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/B.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 comps +{ + public class B + { + public function B() + { + } + } +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js b/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js new file mode 100644 index 0000000..643887e --- /dev/null +++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js @@ -0,0 +1,20 @@ +/** + * 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. + */ +goog.provide('comps.B'); + +/** + * @constructor + */ +comps.B = function() { +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as b/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as new file mode 100644 index 0000000..c4bd427 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/files/SimpleAS.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 org.apache.flex +{ + +import flash.events.IEventDispatcher; + +import mx.components.Button; + +import spark.components.Button; + +public dynamic class A extends spark.components.Button implements IEventDispatcher +{ + public static const MY_CLASS_CONST:String = "myClassConst"; + + public function A() + { + trace(typeof "a"); + } + + private var _a:ArgumentError = new ArgumentError(); + + private var _mxButton:mx.components.Button = new mx.components.Button(); + + public const MY_INSTANCE_CONST:String = "myInstanceConst"; +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js b/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js new file mode 100644 index 0000000..a063d87 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js @@ -0,0 +1,72 @@ +/** + * 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. + */ +/** + * org.apache.flex.A + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('org.apache.flex.A'); + + + +/** + * @constructor + * @extends {vf2js_s.components.Button} + * @implements {flash.events.IEventDispatcher} + */ +org.apache.flex.A = function() { + org.apache.flex.A.base(this, 'constructor'); + org.apache.flex.utils.Language.trace(typeof("a")); +}; +goog.inherits(org.apache.flex.A, vf2js_s.components.Button); + + +/** + * @const + * @type {string} + */ +org.apache.flex.A.MY_CLASS_CONST = "myClassConst"; + + +/** + * @private + * @type {ArgumentError} + */ +org.apache.flex.A.prototype._a = new ArgumentError(); + + +/** + * @private + * @type {vf2js_mx.components.Button} + */ +org.apache.flex.A.prototype._mxButton = new vf2js_mx.components.Button(); + + +/** + * @const + * @type {string} + */ +org.apache.flex.A.prototype.MY_INSTANCE_CONST = "myInstanceConst"; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +org.apache.flex.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'org.apache.flex.A'}], interfaces: [flash.events.IEventDispatcher] }; + http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml new file mode 100644 index 0000000..a403052 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx"> + + <s:Button label="hello" x="100" /> + + <s:Button label="bye" x="200" /> + +</vf2js_s:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js new file mode 100644 index 0000000..0beed58 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js @@ -0,0 +1,67 @@ +/** + * 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. + */ +/** + * SimpleMXML + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('SimpleMXML'); + +goog.require('spark.components.Application'); +goog.require('spark.components.Button'); + + + + +/** + * @constructor + * @extends {spark.components.Application} + */ +SimpleMXML = function() { + SimpleMXML.base(this, 'constructor'); + + /** + * @private + * @type {spark.components.Button} + */ + this.$ID0; + + /** + * @private + * @type {spark.components.Button} + */ + this.$ID1; +}; +goog.inherits(SimpleMXML, spark.components.Application); + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +SimpleMXML.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SimpleMXML', qName: 'SimpleMXML' }] }; + + +/** + * start + * + * @export + */ +SimpleMXML.prototype.start = function () { +}; + http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/Version.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/files/Version.as b/compiler-jx/src/test/resources/vf2js/files/Version.as new file mode 100644 index 0000000..496ab63 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/files/Version.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. +// +//////////////////////////////////////////////////////////////////////////////// +import mx.core.mx_internal; + +/** + * @private + * Version string for this class. + */ +mx_internal static const VERSION:String = "4.14.0.0"; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as new file mode 100644 index 0000000..d89743e --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 interfaces.IA; + import interfaces.IC; + import interfaces.IE; + + public class Test extends A implements IA, IE + { + public function Test() + { + super(); + + var ia:IA = doSomething(IC) as IA + } + + public function doSomething(ic:IC):IC + { + for (var i:int = 0; i < 3; i++ { + var a:A = null; + } + + super.doStuff(); + + return ic; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js new file mode 100644 index 0000000..f547b18 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js @@ -0,0 +1,64 @@ +/** + * 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} + */ + +goog.provide('Test'); + +goog.require('classes.A'); +goog.require('interfaces.IA'); +goog.require('interfaces.IC'); +goog.require('interfaces.IE'); +goog.require('org.apache.flex.utils.Language'); + + + +/** + * @constructor + * @extends {classes.A} + * @implements {interfaces.IA} + * @implements {interfaces.IE} + */ +Test = function() { + Test.base(this, 'constructor'); + var /** @type {interfaces.IA} */ ia = org.apache.flex.utils.Language.as(this.doSomething(interfaces.IC), interfaces.IA); +}; +goog.inherits(Test, classes.A); + + +/** + * @export + * @param {interfaces.IC} ic + * @return {interfaces.IC} + */ +Test.prototype.doSomething = function(ic) { + for (var /** @type {number} */ i = 0; i < 3; i++) { + var /** @type {classes.A} */ a = null; + } + this.superClass_.doStuff.call(this); + return ic; +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}], interfaces: [interfaces.IA, interfaces.IE] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as new file mode 100644 index 0000000..20a6a11 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as @@ -0,0 +1,32 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 A extends C + { + public function A() + { + super(); + } + + public function doStuff():void{ + trace("STUFF!!!"); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js new file mode 100644 index 0000000..842e665 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js @@ -0,0 +1,51 @@ +/** + * 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} + */ + +goog.provide('classes.A'); + +goog.require('classes.C'); + + + +/** + * @constructor + * @extends {classes.C} + */ +classes.A = function() { + classes.A.base(this, 'constructor'); +}; +goog.inherits(classes.A, classes.C); + + +/** + * @export + */ +classes.A.prototype.doStuff = function() { + org.apache.flex.utils.Language.trace("STUFF!!!"); +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as new file mode 100644 index 0000000..b410e59 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/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/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js new file mode 100644 index 0000000..d8e3b89 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js @@ -0,0 +1,37 @@ +/** + * 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} + */ + +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'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as new file mode 100644 index 0000000..d414a26 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/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/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js new file mode 100644 index 0000000..c3b72f4 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js @@ -0,0 +1,37 @@ +/** + * 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} + */ + +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'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as new file mode 100644 index 0000000..5fbd6c2 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.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 IA extends IC {} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js new file mode 100644 index 0000000..2a00144 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js @@ -0,0 +1,41 @@ +/** + * 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} + */ + +goog.provide('interfaces.IA'); + +goog.require('interfaces.IC'); + + + +/** + * @interface + * @extends {interfaces.IC} + */ +interfaces.IA = function() { +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}], interfaces: [interfaces.IC] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as new file mode 100644 index 0000000..a995635 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/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/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js new file mode 100644 index 0000000..d4933c8 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js @@ -0,0 +1,38 @@ +/** + * 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} + */ + +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'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as new file mode 100644 index 0000000..9183bac --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/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 ID {} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js new file mode 100644 index 0000000..9e5298b --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js @@ -0,0 +1,41 @@ +/** + * 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} + */ + +goog.provide('interfaces.IC'); + +goog.require('interfaces.ID'); + + + +/** + * @interface + * @extends {interfaces.ID} + */ +interfaces.IC = function() { +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}], interfaces: [interfaces.ID] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as new file mode 100644 index 0000000..d5e9543 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.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 ID {} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js new file mode 100644 index 0000000..a730bbb --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js @@ -0,0 +1,38 @@ +/** + * 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.ID + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('interfaces.ID'); + + + +/** + * @interface + */ +interfaces.ID = function() { +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +interfaces.ID.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'ID', qName: 'interfaces.ID'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as new file mode 100644 index 0000000..d2c7ce1 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 IE { + function myMethod():void; + function get myProp():String; + function set myProp(value:String):void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js new file mode 100644 index 0000000..63d68c7 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js @@ -0,0 +1,53 @@ +/** + * 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.IE + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('interfaces.IE'); + + + +/** + * @interface + */ +interfaces.IE = function() { +}; + + +interfaces.IE.prototype.myMethod = function() {}; + + +/** + * @return {string} + */ +interfaces.IE.prototype.get_myProp = function() {}; + + +/** + * @param {string} value + */ +interfaces.IE.prototype.set_myProp = function(value) {}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +interfaces.IE.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IE', qName: 'interfaces.IE'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as new file mode 100644 index 0000000..52541c2 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as @@ -0,0 +1,68 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 mx.core.mx_internal; + +import bases.HelperBaseClass; + +use namespace mx_internal; + +public class SomeSDKClass +{ + public function SomeSDKClass() {}; + + private var number:Number = 'Got it: ' + this.getString(); + + public function getString():String + { + return Helper.helperFunction(); + } + + public function someFunction():String + { + helperBaseClass.doSomething(); + } + + mx_internal var helperBaseClass:HelperBaseClass = new HelperBaseClass(); +} + +} + +import bases.HelperBaseClass; + +class Helper extends HelperBaseClass +{ + + public static function helperFunction():String { + return "Hello world"; + } + + public function Helper(url:String) { + url_ = url; + } + + private var url_:String; + + public function get url():String { + return url_; + } + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js new file mode 100644 index 0000000..fd32667 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js @@ -0,0 +1,114 @@ +/** + * 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. + */ +/** + * SomeSDKClass + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('SomeSDKClass'); + +goog.require('bases.HelperBaseClass'); +goog.require('mx.core.mx_internal'); +goog.require('org.apache.flex.utils.Language'); + + + +/** + * @constructor + */ +SomeSDKClass = function() { + this.number = 'Got it: ' + this.getString(); + + this.helperBaseClass = new bases.HelperBaseClass(); +}; + + +/** + * @private + * @type {number} + */ +SomeSDKClass.prototype.number; + + +/** + * @export + * @return {string} + */ +SomeSDKClass.prototype.getString = function() { + return Helper.helperFunction(); +}; + + +/** + * @export + * @return {string} + */ +SomeSDKClass.prototype.someFunction = function() { + this.helperBaseClass.doSomething(); +}; + + +/** + * @type {bases.HelperBaseClass} + */ +SomeSDKClass.prototype.helperBaseClass; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +SomeSDKClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SomeSDKClass', qName: 'SomeSDKClass'}] }; + + + +/** + * @constructor + * @extends {bases.HelperBaseClass} + * @param {string} url + */ +Helper = function(url) { + Helper.base(this, 'constructor', url); + this.url_ = url; +}; +goog.inherits(Helper, bases.HelperBaseClass); + + +/** + * @export + * @return {string} + */ +Helper.helperFunction = function() { + return "Hello world"; +}; + + +/** + * @private + * @type {string} + */ +Helper.prototype.url_; + + +/** + * @export + * @return {string} + */ +Helper.prototype.get_url = function() { + return this.url_; +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as new file mode 100644 index 0000000..487990a --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 bases +{ + +public class HelperBaseClass +{ + + public function HelperBaseClass() {}; + + public function doSomething():String { + return 'doneSomething'; + } + +} + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js new file mode 100644 index 0000000..2460bb0 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js @@ -0,0 +1,46 @@ +/** + * 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. + */ +/** + * bases.HelperBaseClass + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('bases.HelperBaseClass'); + + + +/** + * @constructor + */ +bases.HelperBaseClass = function() {}; + + +/** + * @export + * @return {string} + */ +bases.HelperBaseClass.prototype.doSomething = function() { + return 'doneSomething'; +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +bases.HelperBaseClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'HelperBaseClass', qName: 'bases.HelperBaseClass'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml new file mode 100644 index 0000000..160b7c9 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" + xmlns:example="example.*" + minHeight="600" + minWidth="955"> + + <fx:Script><![CDATA[ + + private var myComponent:Component = new Component(); + + ]]></fx:Script> + + <fx:Declarations> + <example:Component myProperty="oops" /> + </fx:Declarations> + +</s:Application> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js new file mode 100644 index 0000000..0acd486 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js @@ -0,0 +1,68 @@ +/** + * 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. + */ +/** + * SimpleMXML_Project + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('SimpleMXML_Project'); + +goog.require('spark.components.Application'); +goog.require('example.Component'); +goog.require('org.apache.flex.utils.Language'); + + + + +/** + * @constructor + * @extends {spark.components.Application} + */ +SimpleMXML_Project = function() { + SimpleMXML_Project.base(this, 'constructor'); + + /** + * @private + * @type {example.Component} + */ + this.$ID0; +}; +goog.inherits(SimpleMXML_Project, spark.components.Application); + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +SimpleMXML_Project.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SimpleMXML_Project', qName: 'SimpleMXML_Project' }] }; + + +/** + * @private + * @type {example.Component} + */ +SimpleMXML_Project.prototype.myComponent; + + +/** + * start + * + * @export + */ +SimpleMXML_Project.prototype.start = function () { +}; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as new file mode 100644 index 0000000..02c03c3 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 example +{ + + public class Component + { + public function Component() + { + super(); + } + + public var myProperty:Object = {}; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js new file mode 100644 index 0000000..89b829f --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js @@ -0,0 +1,45 @@ +/** + * 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. + */ +/** + * example.Component + * + * @fileoverview + * + * @suppress {checkTypes} + */ + +goog.provide('example.Component'); + + + +/** + * @constructor + */ +example.Component = function() { + ; +}; + + +/** + * @type {Object} + */ +example.Component.prototype.myProperty = {}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +example.Component.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Component', qName: 'example.Component'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Base.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Base.as b/compiler-jx/src/test/resources/vf2js/projects/super/Base.as new file mode 100644 index 0000000..ee69d65 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/super/Base.as @@ -0,0 +1,65 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 static var myClassConst:String = new Number(); + + public function Base() + { + super(); + }; + + private var number:Number = this.getNumber(); + + private var newText:String = this.text; + + private var newTextAgain:String = text; + + override public function get text():String + { + return "A" + super.text; + }; + + override public function set text(value:String):void + { + if (value != super.text) + { + super.text = "B" + value; + } + }; + + public function getNumber():void + { + alert(super.doStuff()); + + var x:Number = super.x; + } + + override public function doStuff():Number + { + throw new Error("No way!"); + }; + +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js b/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js new file mode 100644 index 0000000..7ca1ad1 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js @@ -0,0 +1,120 @@ +/** + * 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} + */ + +goog.provide('Base'); + +goog.require('Super'); +goog.require('org.apache.flex.utils.Language'); + + + +/** + * @constructor + * @extends {Super} + */ +Base = function() { + + Base.myClassConst = new Number(); + + this.number = this.getNumber(); + + this.newText = this.get_text(); + + this.newTextAgain = this.get_text(); + Base.base(this, 'constructor'); +}; +goog.inherits(Base, Super); + + +/** + * @type {string} + */ +Base.myClassConst; + + +/** + * @private + * @type {number} + */ +Base.prototype.number; + + +/** + * @private + * @type {string} + */ +Base.prototype.newText; + + +/** + * @private + * @type {string} + */ +Base.prototype.newTextAgain; + + +/** + * @export + * @return {string} + * @override + */ +Base.prototype.get_text = function() { + return "A" + Base.base(this, 'get_text'); +}; + + +/** + * @export + * @param {string} value + * @override + */ +Base.prototype.set_text = function(value) { + if (value != Base.base(this, 'get_text')) { + Base.base(this, 'set_text', "B" + value); + } +}; + + +/** + * @export + */ +Base.prototype.getNumber = function() { + alert(this.superClass_.doStuff.call(this)); + var /** @type {number} */ x = this.get_x(); +}; + + +/** + * @export + * @return {number} + * @override + */ +Base.prototype.doStuff = function() { + throw new Error("No way!"); +}; + + +/** + * 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/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Super.as ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Super.as b/compiler-jx/src/test/resources/vf2js/projects/super/Super.as new file mode 100644 index 0000000..3a2bca2 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/super/Super.as @@ -0,0 +1,54 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 var _text:String = ''; + + public function get text():String + { + return _text; + }; + + public function set text(value:String):void + { + if (value != _text) + { + _text = value; + } + }; + + private var _x:Number = 5; + + public function get x():Number + { + return _x; + }; + + public function doStuff():Number + { + return "Stuff is done"; + }; + +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js b/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js new file mode 100644 index 0000000..d8bfa78 --- /dev/null +++ b/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js @@ -0,0 +1,89 @@ +/** + * 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} + */ + +goog.provide('Super'); + + + +/** + * @constructor + */ +Super = function() {}; + + +/** + * @private + * @type {string} + */ +Super.prototype._text = ''; + + +/** + * @export + * @return {string} + */ +Super.prototype.get_text = function() { + return this._text; +}; + + +/** + * @export + * @param {string} value + */ +Super.prototype.set_text = function(value) { + if (value != this._text) { + this._text = value; + } +}; + + +/** + * @private + * @type {number} + */ +Super.prototype._x = 5; + + +/** + * @export + * @return {number} + */ +Super.prototype.get_x = function() { + return this._x; +}; + + +/** + * @export + * @return {number} + */ +Super.prototype.doStuff = function() { + return "Stuff is done"; +}; + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +Super.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Super', qName: 'Super'}] }; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.classpath ---------------------------------------------------------------------- diff --git a/compiler.js/.classpath b/compiler.js/.classpath deleted file mode 100644 index bfc5a23..0000000 --- a/compiler.js/.classpath +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="build/generatedSrc/as3.codegen"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="lib/google/closure-compiler/compiler.jar"/> - <classpathentry kind="lib" path="lib/org.apache.felix.framework-3.0.2.jar"/> - <classpathentry kind="lib" path="lib/antlr.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/compiler"/> - <classpathentry kind="lib" path="lib/commons-cli.jar"/> - <classpathentry kind="lib" path="lib/commons-io.jar"/> - <classpathentry kind="output" path="classes"/> -</classpath> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.gitignore ---------------------------------------------------------------------- diff --git a/compiler.js/.gitignore b/compiler.js/.gitignore deleted file mode 100644 index d3bc09e..0000000 --- a/compiler.js/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# ignored files/directories for the 'compiler.js' project -/build -/classes -/in -/intermediates -/lib \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.project ---------------------------------------------------------------------- diff --git a/compiler.js/.project b/compiler.js/.project deleted file mode 100644 index ceb17b3..0000000 --- a/compiler.js/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>compiler.js</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription>