Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34992

Missing FLEXJS_CLASS_INFO in class internal to a file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Apache FlexJS 0.5.0
    • Apache FalconJX 0.6.0
    • Falcon, FlexJS
    • None

    Description

      In the example below, notice that the InternalClass output does not include FLEXJS_CLASS_INFO, so the "as" operator in testFunction() will return null and iti.test() will crash.

      AS input:

      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 { }
      }
      

      JS output:

      /**
       * 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() {
      };
      

      Attachments

        Activity

          People

            aharui Alex Harui
            adufilie Andy Dufilie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: