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

[question] has some invalid arguments

Aug 15, 2013 at 9:49 AM
hi,jurassic is powerful ,I love it
and I got a issue here
(function () { "use strict";
var Main = function() { }

Main.main = function() {

and I defined settimeout here
 public static IDisposable SetTimeout(Action method, int delayInMilliseconds)
        System.Timers.Timer timer = new System.Timers.Timer(delayInMilliseconds);
        timer.Elapsed += (source, e) =>

        timer.AutoReset = false;
        timer.Enabled = true;

        // Returns a stop handle which can be used for stopping
        // the timer, if required
        return timer as IDisposable;
and my error:
JavaScriptException: TypeError: The best method overload IDisposable SetTimeout(System.Action, Int32) has some invalid arguments
Jurassic.Compiler.BinderUtilities.ResolveOverloads (System.RuntimeMethodHandle[],Jurassic.ScriptEngine,object,object[]) <IL 0x003b5, 0x010c3>
(wrapper dynamic-method) object.binder_for_EasyTimer.SetTimeout (Jurassic.ScriptEngine,object,object[]) <IL 0x00015, 0x0008c>

how can I fixed this settimeout call  js function  problem? thanks 
Aug 15, 2013 at 9:12 PM
You should change your SetTimeout method so that it accepts a Jurassic.Library.FunctionInstance (instead of Action). This type represents a javascript function. Then to call the function, use the Call() method.