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]);
}
}