Actually your not. I verified this as well, it has something with the object
not being deleted.

the snippet inside Class where Mutators are are injected.

            for (var mutator in Class.Mutators){
                if (!this[mutator]) continue;
                Class.Mutators[mutator](this, this[mutator]);
                delete this[mutator];
            }

I was working off the assumption that the last line would delete 'Privates',
it doesn't. It appears that the last line doesn't delete.

Even if  I set a line before the delete line

this[mutator] = "";
or
this[mutator] = undefined;

the property still does not get destroyed.

After the delete line if I add the follow everything works fine:

if($type(this[mutator]) == 'object') for(prop in this[mutator]) delete
this[mutator][prop];

if I add that line before the the delete line it doesn't work




On Sun, Oct 12, 2008 at 3:47 PM, Ryan J. Salva <[EMAIL PROTECTED]>wrote:

>
> I think I must be missing something here. Nathan, in your example from
> the blog, my understanding is that I should be be able to get a result
> from:
>
> var msg = new Secret();
> alert(msg.Privates.secret);
>
> ... and yet, there it is. I can easily access private functions and
> variables from outside the object. Can you help me understand?
>
> Thanks!
> rjs
>
>
> On Oct 10, 1:47 pm, "Nathan White" <[EMAIL PROTECTED]> wrote:
> > ok. I have made two updates to my Privates Mutator.
> >
> > Now if you pass in functions into the privates object a bind is created
> to
> > the class.
> >
> > http://www.nwhite.net/2008/10/10/private-methods-with-mootools-update2/
> >
> > an example is provided.
>

Reply via email to