Jurassic.Library.FunctionInstance.__STUB__Apply C# (CSharp) Method

__STUB__Apply() private static method

private static __STUB__Apply ( ScriptEngine engine, object thisObj, object args ) : object
engine ScriptEngine
thisObj object
args object
return object
        private static object __STUB__Apply(ScriptEngine engine, object thisObj, object[] args)
        {
            thisObj = TypeConverter.ToObject(engine, thisObj);
            if (!(thisObj is FunctionInstance))
                throw new JavaScriptException(engine, ErrorType.TypeError, "The method 'apply' is not generic.");
            switch (args.Length)
            {
                case 0:
                    return ((FunctionInstance)thisObj).Apply(Undefined.Value, Undefined.Value);
                case 1:
                    return ((FunctionInstance)thisObj).Apply(args[0], Undefined.Value);
                default:
                    return ((FunctionInstance)thisObj).Apply(args[0], args[1]);
            }
        }