coffeescript-repl icon indicating copy to clipboard operation
coffeescript-repl copied to clipboard

Nesting of arrays not displayed

Open jlfwong opened this issue 13 years ago • 2 comments

All of the [ and ] are dropped in the display:

coffee> [1,2,3]
1,2,3
coffee> [[1,2,3]]
1,2,3
coffee> [[1,2,3],[4,5,6]]
1,2,3,4,5,6
coffee> [1,[2,[3,4,5,6]]]
1,2,3,4,5,6

jlfwong avatar May 13 '12 05:05 jlfwong

That's because Array.prototype.toString is being used naively. Some equivalent to node's util.inspect needs to be used.

michaelficarra avatar May 13 '12 15:05 michaelficarra

I just pushed a complete rewrite with one of the changes being to use node's util.inspect for output, as Michael suggested (thanks!). Arrays should be printing all pretty-like now.

larryng avatar May 13 '12 21:05 larryng