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

Bug compiling binding with [Bindable] function and static access

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.1 (Release)
    • None
    • Data Binding
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Safari
      Language Found: English

    Description

      Steps to reproduce:
      1. Create method with [Bindable("change")]

      [Bindable("change")]
      protected function method1(str:String):String

      { return str; }

      2. Create method with static property or method

      package
      {
      public class StaticClass
      {
      public static function staticMethod(str:String):String

      { return str; }

      }
      }

      3. Call method, passing in static method or property in MXML Binding expression

      <s:Label text="

      {method2([StaticClass.staticMethod('blob')])}

      "/>

      Actual Results:
      Compiler generates bad code, concatenating "target" on the static class: "StaticClasstarget"

      public class _StaticMXMLBindingBugWatcherSetupUtil
      implements mx.binding.IWatcherSetupUtil2
      {
      public function setup(target:Object,
      propertyGetter:Function,
      staticPropertyGetter:Function,
      bindings:Array,
      watchers:Array):void
      {

      watchers[2] = new mx.binding.FunctionReturnWatcher("method2",
      target,
      function():Array

      { return [ [StaticClasstarget.staticMethod("blob")] ]; }

      ,

      { change: true }

      ,
      [bindings[1]],
      propertyGetter
      );

      }

      }

      Expected Results:
      Should compile correctly

      Workaround (if any):

      Wrap access to static property or method in a local method.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: