Yep, it's suppose to be read-only
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:name

On Jun 9, 12:31 am, Jeff Watkins <[EMAIL PROTECTED]> wrote:
> Off the top of my head, I'd guess you're using FireFox. I know the JS  
> engine in FireFox (SpiderMonkey) exposes the name of a function via  
> the `name` property, however, I don't know whether that property is  
> mutable.
>
> My guess, from the behaviour of your code, is `name` is not a mutable  
> property.
>
> On 8 Jun, 2008, at 9:06 PM, Franck PORCHER wrote:
>
>
>
> > Hello,
>
> > I have been trying for days o understand what I have missed.
>
> > I have narrowed down the problem to this, where I create a simple  
> > class 'foo' that I extend to assign a private member 'name' set to  
> > 'FOO':
> >      var foo = Class.create({});
> >     Object.extend( foo, {  name : 'FOO' } );
> > Then :
> >      alert(foo.name)
> > surprisingly displays
> >      klass
> > (instead of FOO)
>
> > Samething if I explicitely force the value to 'FOO'
> >      foo.name = 'FOO'
> > Is there someone in the position to tell me what is going on, and  
> > why foo's private member 'name' does not hold its value. This does  
> > not happen if I choose another name for the private member.
>
> > This has been most upsetting to me for days now, and I fail to  
> > understand what I am missing.
>
> > So thank you to anyone who would help me understand my mistake if  
> > this is not a bug.
>
> > Franck PORCHER
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to