Then this opens up the whole can of worms of, well if we're adding explicit
support for this non-iterable property, why not others, and the list could
grow along with any resulting code.

If anything, I'd add support for passing an array of member names to check
for at extend-time (thus making it extensible)... but I'm not thinking
changing Object.extend is the level to do any of this.

I'm all about leaving the core as just that, _core_ functionality, and
leaving it to the devs using it to override or put any kind of wrappers they
want around the functions.

For instance, in this case:

var oldExtend = Object.extend;
Object.extend = function(destination, source) {
if (source.toString) {
//add support for copying toString()
          destination.toString = source.toString;
return oldExtend(destination, source);

On 5/30/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote:
> On 5/30/07, jdalton <[EMAIL PROTECTED]> wrote:
> >
> >
> > I was looking through some of my old source code and noticed that I
> > added a modified Object.extend method.
> > Apparently the normal for-in loop used in the Object.extend guts
> > ignores methods named 'toString'.
> Yeah, toString is non-iterable in JS. But before applying this we must
> make sure it doesn't break anything!
> I'm kinda reluctant to even consider chaning Object.extend.
> >

Ryan Gahl
Principal, Manager
Nth Penguin, LLC - Consulting
Software Architect /
Future Home of the World's First Complete Web Platform
Inquire: 1-262-951-6727

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to