[Laszlo-dev] release note for 'implicit this'

Donald Anderson dda at ddanderson.com
Thu Mar 26 10:09:46 PDT 2009


Lou, can you add this as a release note or update the doc as you see  
fit?
Tucker, can you review this?  This is related to LPP-7965.

Before 4.2.1, attributes created in code were allowed to be freely  
used without a 'this' qualifier.
For example this code was allowed:
      this.myattr = "hello";
      var something = myattr;   // 'this.myattr' is implied

In 4.2.1, this is no longer supported.  The programmer has two  
choices.  The preferred approach is
to declare the attribute in question using <attribute/>, like so:

      <attribute name="myattr" type="string" />

An alternative would be to explicitly use 'this' in all usages:

      this.myattr = "hello";
      var something = this.myattr;

The old behavior is still allowed for SWF8 and DHTML runtimes, but may  
be marked deprecated in the future.


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: dda at ddanderson.com
www: http://www.ddanderson.com





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090326/c5bb2f35/attachment-0001.html


More information about the Laszlo-dev mailing list