Returning JS Function to C#

Sep 18, 2013 at 5:08 PM

I have some code like this:

return new function(a, b) { return a + b; }

var raw new JintEngine().Run(script);

I can see that "raw" is a JsFunction instance, but I can't figure out how to invoke it. How do I do this?

The next step (if this is possible, first) is to typecast it to a delegate. For example, I want to add the delegate:

delegate int MathFunction(int x, int y);

I will then need to convert "raw" into an instance of MathFunction. Is this possible too?