Skip to content
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

Returning objects is currently not possible #34

Open
chaser92 opened this issue Jul 24, 2014 · 2 comments
Open

Returning objects is currently not possible #34

chaser92 opened this issue Jul 24, 2014 · 2 comments

Comments

@chaser92
Copy link

When returning a result object from shovel.js, you're using util.inspect - however, an object passed this way will not be usable on the other side (after JSON.parse, it will be a string that can't be turned back to a JSON, unless one uses eval()). Omitting util.inspect would be enough for this to work as JSON.stringify works recursively.

@rfn01
Copy link

rfn01 commented Dec 29, 2015

It does seem that JSON.stringify() would be nicer. Is there a reason to stick with util.inspect() here? (Asked with humility, as I'm pretty new to node.js.)

@soichih
Copy link

soichih commented Jan 24, 2017

I had to use eval() because of this..

I believe the way I am using Sandbox is such that, running eval() on output.result should be safe.. but this gives me a bit of heebie jeebies.. It would be nice if I could just use JSON.parse directly.

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

3 participants