ScriptFunctionInstance and toString

Mar 6, 2015 at 12:53 PM
Thanks for all the good work on the latest jint, but on upgrading to this from the previous version, we've discovered a couple of issues that I thought might be worth reporting.

We were callling toString on a function object, which allowed us to interrogate it in the script. For instance, if we run the following in javascript -

function SayGoose(gooseType){
return gooseType + " goose";
}

eval('SayGoose').toString()

we get -

function SayGoose(gooseType){
return gooseType + " goose";
}

This allowed us to dynamically get a list of a function's parameters. Unfortunately this doesn't seem to have been implemented yet in jint 2, so all we get is "function(){...}" , which is obviously useless for our purposes.

The workaround was to try to pass the ScriptFunctionInstance out into managed code, but this doesn't help too, as the function declaration is private.
Coordinator
Mar 6, 2015 at 5:51 PM
Could you file these bugs in the github repository?

Thanks