On 10/24/07, Jean-Philippe Encausse <[EMAIL PROTECTED]> wrote:
> Unfortunately, using it has brought this issue to our attention :
> If another javascript API extends javascript object using
> Object.prototype, prototype.js will break in several places when
> calling
> for/in loops.

Months ago, I started an initiative to replace all for..in loops in
Prototype with "safe" loops (ones that check if a property is inherited from
Object.prototype and skip it). However, I was quickly convinced by Sam and
others that this effort is futile - it would make all the loops slower just
to support a practice that is forbidden in JavaScript world.

In short, Object prototype is verboten. Prototype library will break if you
augment Object.prototype, and this is not likely to change.

Your test page uses json.js, the most common culprit of this breakage.
Prototype users complained a lot that they can't use JSON with Prototype
since it breaks Ajax (that was the breakage most visible when you augment
Object.prototype). Since then, Tobie Langel has done so much wonderful work
on JSON in Prototype that there is no need for json.js anymore. We could
say, json.js is verboten :)

I hope this clears up the issue.

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

Reply via email to