This project has moved and is read-only. For the latest updates, please go here.


Dec 5, 2010 at 11:03 AM


Nice engine! I'm trying to do a simple callback, is this possible? I have this basic example:

var engine = new Jurassic.ScriptEngine();
var script = @"
function abc()

engine.SetGlobalFunction("puts", new Action<string>((msg) => { Console.WriteLine(msg); }));
engine.SetGlobalFunction("test", new Func<FunctionDelegate, object>((fn) =>
    return null;

I get the error Unhandled Exception: System.NotImplementedException: Unsupported parameter type 'Jurassic.Library.FunctionDelegate'.

Can suggest what I may be doing wrong?


Dec 5, 2010 at 12:19 PM

As the error message suggests, FunctionDelegate is not supported as a method parameter type.  Use FunctionInstance instead.

The supported types are documented here: (FunctionInstance is not explicitly mentioned, but is a derived from ObjectInstance).

Dec 5, 2010 at 12:27 PM

By the way, congrats for being the first poster :-)

You don't win a prize, sorry :-(