this might actually prove to be quite useful - i can see how this might let
you share variables between different instances of a class without using a
global object. this is sometimes a very desirable functionality!
-----------
אריה גלזר
052-5348-561
5561


On Sun, Jan 31, 2010 at 22:15, Roman Land <[email protected]> wrote:

> Hi,
>
> I found out (the "bug" way ;) ) that if I write a class like so:
>
> MyClass = new Class({
>
>     myHash : new Hash()
>
> })
>
> Later I will use this class
>
> a = new MyClass();
>
> b = new MyClass();
>
> I would seem that the hash is actually being shared :P
> My work around is to init the hash in the "initialize" method.
>
> Any thought about this? I dont like the aesthetics of this
> implementation...
>
> Cheers
> Roman
>
> --
> ---
> "Make everything as simple as possible, but not simpler."
>
> - Albert Einstein
>
>

Reply via email to