#ifndef _FUNCTION_OBJECT_H_
#define _FUNCTION_OBJECT_H_
#include "internal.h"
#include "object_object.h"
#include "function.h"
namespace KJS {
class FunctionPrototypeImp : public InternalFunctionImp {
public:
FunctionPrototypeImp(ExecState *exec);
virtual ~FunctionPrototypeImp();
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
};
class FunctionProtoFuncImp : public InternalFunctionImp {
public:
FunctionProtoFuncImp(ExecState *exec,
FunctionPrototypeImp *funcProto, int i, int len);
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
enum { ToString, Apply, Call };
private:
int id;
};
class FunctionObjectImp : public InternalFunctionImp {
public:
FunctionObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto);
virtual ~FunctionObjectImp();
virtual bool implementsConstruct() const;
virtual Object construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber);
virtual Object construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
};
};
#endif // _FUNCTION_OBJECT_H_