output.console is empty #17

Open
speg opened this Issue Apr 14, 2012 · 5 comments

Comments

Projects
None yet
4 participants

speg commented Apr 14, 2012

var code = "function add( a, b ){console.log( a );console.log( b );return a + b}add( 20, 22 );";


s.run( code, function( output ) {
  console.log(output.result + "\n" + output.console);
})

Yields:

42
Owner

gf3 commented Apr 15, 2012

Ruh roh, I'll have a look into this. Thanks for the report. BTW which version of both Sandbox and Node are you using?

@ghost ghost assigned gf3 Apr 15, 2012

speg commented Apr 25, 2012

Sorry for the delay.

Node: v0.6.15
Sandbox: 0.8.3

TimNZ commented Aug 8, 2012

Bump

Node 0.8.5
Latest sandbox from here

TimNZ commented Aug 8, 2012

I've never submitted a patch but will do it at some point.

In shovel.js, change line 65:
console.push.apply(console, JSON.parse(value).slice(1));
to
console.push.apply(console, JSON.parse(value));

I can't see how the slice ended up there, or the reason for the convoluted push.apply as I'm a novice JSer.

wupsbr commented Dec 15, 2012

The @TimNZ suggestion worked for me! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment