Writing attribute based setters in JS2

View: New views
2 Messages — Rating Filter:   Alert me  

Writing attribute based setters in JS2

by Raju Bitter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

How can I define the setter for an attribute in JS2 syntax?

<attribute name="url" value="" type="string" setter="this._setUrl(url)"/

Where are the setters for a class attribute stored?

Thanks,
Raju



Re: Writing attribute based setters in JS2

by P T Withington :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 From your later mail, I think you figured this out, a setter gets a  
special name:

   function $lzc$set_url (newvalue) { this._setUrl(newvalue) }

This is just a temporary placeholder until we can implement the real  
JS2 syntax for setters, which would be:

   function set url (newvalue) { this._setUrl(newvalue) }

On 2008-07-19, at 17:58EDT, Raju Bitter wrote:

> Hi all,
>
> How can I define the setter for an attribute in JS2 syntax?
>
> <attribute name="url" value="" type="string"  
> setter="this._setUrl(url)"/
>
> Where are the setters for a class attribute stored?
>
> Thanks,
> Raju
>
>