Andy Dufilie created FLEX-34992:
-----------------------------------
Summary: Missing FLEXJS_CLASS_INFO in class internal to a file
Key: FLEX-34992
URL: https://issues.apache.org/jira/browse/FLEX-34992
Project: Apache Flex
Issue Type: Bug
Components: Falcon, FlexJS
Affects Versions: Apache FlexJS 0.5.0
Reporter: Andy Dufilie
Priority: Minor
In the example below, notice that the InternalClass output does not include
FLEX_CLASS_INFO, so the "as" operator in testFunction() will return null and
iti.test() will crash.
AS input:
{code}
package foo.bar {
public class TestMissingFlexClassInfo {
public function testFunction():void {
var iti:ITestInterface = new InternalClass() as
ITestInterface;
iti.test();
}
}
}
import foo.bar.ITestInterface;
internal class InternalClass implements ITestInterface {
public function test():void { }
}
{code}
JS output:
{code}
/**
* Generated by Apache Flex Cross-Compiler from
foo\bar\TestMissingFlexClassInfo.as
* foo.bar.TestMissingFlexClassInfo
*
* @fileoverview
*
* @suppress {checkTypes}
*/
goog.provide('foo.bar.TestMissingFlexClassInfo');
goog.require('foo.bar.ITestInterface');
/**
* @constructor
*/
foo.bar.TestMissingFlexClassInfo = function() {
};
/**
* @export
*/
foo.bar.TestMissingFlexClassInfo.prototype.testFunction = function() {
var /** @type {foo.bar.ITestInterface} */ iti =
org.apache.flex.utils.Language.as(new InternalClass(), foo.bar.ITestInterface);
iti.test();
};
/**
* Metadata
*
* @type {Object.<string, Array.<Object>>}
*/
foo.bar.TestMissingFlexClassInfo.prototype.FLEXJS_CLASS_INFO = { names: [{
name: 'TestMissingFlexClassInfo', qName: 'foo.bar.TestMissingFlexClassInfo'}] };
/**
* @constructor
* @implements {foo.bar.ITestInterface}
*/
InternalClass = function() {
};
/**
* @export
*/
InternalClass.prototype.test = function() {
};
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)