gf3 / sandbox

A nifty JavaScript sandbox for Node.js
ISC License
844 stars 123 forks source link

showel.js - result: util.inspect( result ) - why? #16

Open dimikot opened 12 years ago

dimikot commented 12 years ago

The resulting object is formed as:

{ result: util.inspect( result ), console: console } )

Why? I suppose it breaks the semantic: why to add additional quoting for the result at that level of abstraction (the more - with util.inspect, which is usable for debugging purposes, not for serialization)?

bmeck commented 12 years ago

Dmitry this is under large discussion on issue #8, we are redoing a fair bit and will add a better serializer, right now it is that way due to circular references, we are moving to fork and adding circular reference support. Functions will still be stripped.

On Tue, Jan 24, 2012 at 10:22 AM, Dmitry Koterov reply@reply.github.com wrote:

The resulting object is formed as:

{ result: util.inspect( result ), console: console } )

Why? I suppose it breaks the semantic: why to add additional quoting for the result at that level of abstraction (the more - with util.inspect, which is usable for debugging purposes, not for serialization)?


Reply to this email directly or view it on GitHub: https://github.com/gf3/sandbox/issues/16

dimikot commented 12 years ago

I suppose you should improve the serializer (and possibly deserializer at the caller side) around the whole

{ result: result, console: console }

construction, not around the result only! I am talking about that. Why additional quoting for one of inner fields?..

bmeck commented 12 years ago

It will be transparent in the future; it is currently stringified for the reasons above.

lmorchard commented 12 years ago

Might be nice to update the docs to reflect this, at least. The weird serialization kind of hit me out of left field