Object.prototype.inspect ?

Tobie Langel tobie.langel at gmail.com
Thu Mar 12 12:08:56 PDT 2009


On Mar 12, 2009, at 19:28 , Jason Orendorff wrote:

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

Anything you would be able to share ?

> There are a few details to nail down (regarding e.g. Arrays that  
> contain
> themselves--try that in Firefox to see something else curious,
> borrowed from Lisp I think...).

Indeed:

var a = [1,2, 3, 4];
a.push(a);
a.toSource();
// -> "#1=[1, 2, 3, 4, #1#]"


More information about the Es-discuss mailing list