[Prototype-core] Re: String.toObject and Object.toString

2009-09-13 Thread Joran
Sometimes the most productive results come from the most dangerous of tools. --~--~-~--~~~---~--~~ 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

[Prototype-core] Re: String.toObject and Object.toString

2009-09-11 Thread Joran
Does that rule out String.toObject()? --~--~-~--~~~---~--~~ 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

[Prototype-core] Re: String.toObject and Object.toString

2009-09-11 Thread kangax
On Sep 11, 8:06 am, Joran jorangr...@gmail.com wrote: Does that rule out String.toObject()? For compatibility with 3rd party code, but more importantly with future (standard and non-standard) and unknown implementations, it's usually a good idea to leave built-in objects alone. Extending them

[Prototype-core] Re: String.toObject and Object.toString

2009-09-11 Thread Joran
The suggestion is not to extend String.prototype with another method, but to rename the current String.evalJSON extension to String.toObject. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To

[Prototype-core] Re: String.toObject and Object.toString

2009-09-11 Thread kangax
On Sep 11, 11:45 am, Joran jorangr...@gmail.com wrote: The suggestion is not to extend String.prototype with another method, but to rename the current String.evalJSON extension to String.toObject. I understand :) The problem is that both - `String.prototype` and `String` are built- in objects

[Prototype-core] Re: String.toObject and Object.toString

2009-09-08 Thread Joran
Dear Tobie Thank you for your reply. Could I suggest a few more questions? 1. Does EcmaScript 5 preclude one from modifying Object.prototype.toString? 2. Over-writing Object.prototype.toString does not at first glance appear to cause it to show up in for...in loops in Rhino, Safari or Firefox.

[Prototype-core] Re: String.toObject and Object.toString

2009-09-08 Thread Jim Higson
On Tuesday 08 September 2009 13:56:14 Joran wrote: Dear Tobie Thank you for your reply. Could I suggest a few more questions? 1. Does EcmaScript 5 preclude one from modifying Object.prototype.toString? 2. Over-writing Object.prototype.toString does not at first glance appear to cause it

[Prototype-core] Re: String.toObject and Object.toString

2009-09-08 Thread Joran
Thanks Jim for the great tip and thanks Robert for the words of caution. It would seem then to be too dangerous to override Object.prototype.toString. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core