sandbox icon indicating copy to clipboard operation
sandbox copied to clipboard

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

Open dimikot opened this issue 13 years ago • 4 comments

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)?

dimikot avatar Jan 24 '12 16:01 dimikot

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 [email protected] 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

bmeck avatar Jan 24 '12 16:01 bmeck

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?..

dimikot avatar Jan 25 '12 12:01 dimikot

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

bmeck avatar Jan 25 '12 16:01 bmeck

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

lmorchard avatar Feb 01 '12 22:02 lmorchard