On 2009-03-12, at 14:28EDT, Jason Orendorff wrote:

On Wed, Mar 11, 2009 at 6:20 AM, Tobie Langel <[email protected]> wrote:
It is very useful to be able to specify the debugging representation of an
object distinctively from it's toJSON or toString representation.

No doubt.  I've implemented similar functionality on every serious
JavaScript project I've done.

Same here, but I bet I did it differently. Which makes me think this is _not_ an area for standardization. As long as there is a standard way to enumerate the properties of an Object and a standard way to determine an Object's 'class' (i.e., constructor, which you can only do in ES3 if you annotate each object yourself), you can write your own inspect and this is a dandy place to allow innovation, IMO.

toSource or repr can learn from Lisp, but if you really want to do it right, we have along way to go. There is a big difference between being able to inspect/debug an object for human legibility and expecting that you can convert an object to a source expression that when evaluated will be "equal" to the original object (for some definition of equal!).
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to