Skip to content

output.console is empty #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

output.console is empty #17

speg opened this issue Apr 14, 2012 · 5 comments
Assignees

Comments

@speg
Copy link

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
@gf3
Copy link
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
Copy link
Author

speg commented Apr 25, 2012

Sorry for the delay.

Node: v0.6.15
Sandbox: 0.8.3

@TimNZ
Copy link

TimNZ commented Aug 8, 2012

Bump

Node 0.8.5
Latest sandbox from here

@TimNZ
Copy link

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants