coercion from javascript functions to .NET delegates?

Oct 18, 2011 at 4:16 PM

Apologies if this question has been answered before, but I could not find an answer in the docs or the discussions.

I registered a function as follows:

_engine.SetFunction("Clock", new Func<Action, double>(_coreApi.Clock));

On the javascript side, I attempt to invoke that function as follows:

Clock(function() {
		result = DoSomething();

which results in the following exception:

Object of type 'Jint.Native.JsFunction' cannot be converted to type 'System.Action'

Am I doing something wrong, or is coercion from javascript functions to .NET delegates not yet supported?

Any help appreciated - thanks!

ps. Love this project - a much needed addition to the .NET toolbox!

Oct 18, 2011 at 7:10 PM

I confirm that this is a bug :(

Nov 18, 2011 at 3:54 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.