Hello!
What you're doing should work. The delegate may not appear to be a JavaScript function (that is, the
For example, this code prints "Hello!" as expected:
Are you doing something differently?
Cheers!
What you're doing should work. The delegate may not appear to be a JavaScript function (that is, the
typeof
operator would return "object" rather than "function"), but it should be invocable just like a function.For example, this code prints "Hello!" as expected:
engine.Execute("function foo(x) { x(); }"); engine.Script.foo(new Action(() => Console.WriteLine("Hello!")));
Cheers!