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. This was the idea behind the suggestion, given the usual
problems with extending Object.prototype. I have not tried other
environments. Are there still other issues?

3. Object.toString returns "[object Object]". Surely returning more
information than this would be no more misleading than the current
implementation? Surely a toString method need not return a string
which exactly describes the object but only a representation thereof?
If point 1 above, would not a JSON representation be further along in
the spirit of being more accurate and informative than "[object
Object]"?

..In the interest of being able to do: Console.log('Object: ' +
object) instead of: Console.log('Object: ' + JSON.stringify(object)).
--~--~---------~--~----~------------~-------~--~----~
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 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to