[mtasc] Property Assignment

Robert Edgar robert.edgar at epresenterplus.com
Wed Dec 7 10:56:21 CET 2005


I probably should test this instead of asking but being lazy today :-)


Say I have this..

 var x = 1;
 x = obj.property = x;

Assuming "property" is a property getter/setter function.

My understanding was that MMC treated this as  

 var x = 1;
 obj.property = x;
 x = obj.property;

Whereas it seems to me MTASC treats it as 

 var x = 1;
 obj.property = x;
 x = x;

This results in different results if in the "property" setter function it
changed the value, i.e. it changes 1 to 2. 
In that case MMC ends with x=2 and MTASC ends with x=1;

My understanding was that whenever you "set" a property in Flash it then
called the getter immediately to allow for this type of chaining (generally
having the setter resulting in a call to the getter is a big nuisance but it
has a use in this case).


Or am I misreading things.
Thanks
Rob 






More information about the mtasc mailing list