Returning JS Function to C#

Sep 18, 2013 at 5:08 PM
Hi,

I have some code like this:

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

C#:
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?