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

Local function doesn't use self to reference class members

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Apache FalconJX 0.8.0
    • FalconJX
    • None

    Description

      The "self" var is defined but not used within localFunction to reference class var "bar".

      ///// ACTIONSCRIPT /////

      package {
      public class foo {
      internal var bar:String = "baz";
      public function foo() {

      function localFunction(i:int) {
      if (i==0)

      { trace( bar ); }


      }

      localFunction(0);
      }
      }
      }

      ///// JAVASCRIPT /////

      foo = function() {
      var self = this;
      function localFunction {
      if (i == 0)

      { org.apache.flex.utils.Language.trace(bar); // Uncaught ReferenceError: bar is not defined }


      };
      localFunction(0);
      };

      Attachments

        Activity

          People

            Unassigned Unassigned
            nimai@beecavegames.com Nimai Malle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: