Calling uneval() on the return value (from script) would do it. If you  
can't call it from the original script, you can compile another script  
that just runs uneval() and pass the result of the first script into it.

Attila.

On 2008.02.11., at 13:04, weepy wrote:

> Hi
>
> I want to call a function in javascript as a script and get back the
> return value as JSON
>
> Is this possible with Rhino ?
>
> E.g.
>
> my.js
> ----
>
> function my_func(x) {
>  return { a: [1,2,3,4], b: "text"}
> }
>
> So I want to call this javascript externally (from Rails) and get back
> the json return. Any help much appreciated.
>
> Jonah
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to