Subj : Re: Serializing JavaScript in spidermonkey To : netscape.public.mozilla.jseng From : Brendan Eich Date : Wed Dec 31 2003 08:48 am Chris Zumbrunn wrote: > Brendan Eich wrote: > >>In my experience there is no best way, because what hides behind a JS >>object can't be expressed in a literal form in the JS language, in full. > > > Douglas Crockford's JSON wouldn't do the job? > > http://www.crockford.com/JSON/index.html Cool, I hadn't kept up with Douglas's stuff. That will work for object trees, but not graphs in general, or objects with private data that cannot be expressed in JS itself (although you could stuff any data into a string, base64-encoded or whatever, the problem of getting the private data to serialize itself, and calling an appropriate deserializing ctor remains, and requires native code extensions). /be .