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

"is" and "as" operators cross-compile incorrectly when using class member variables

    XMLWordPrintableJSON

Details

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

    Description

      When using "is" or "as" operators, the right operand cross-compiles incorrectly if it references a class member variable.

      Example code:

      private var classDef:Class = String;
      public function test1(param:Object):Object
      {
      	if (param is this.classDef)
      		return param as this.classDef;
      	return null;
      }
      

      Cross-compiled:

      WeaveTest.prototype.classDef;
      WeaveTest.prototype.test1 = function(param) {
        if (org.apache.flex.utils.Language.is(param, classDef))
          return org.apache.flex.utils.Language.as(param, classDef);
        return null;
      };
      

      The right operand becomes classDef instead of this.classDef.

      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: