#ifndef RUNTIME_FUNCTION_H_
#define RUNTIME_FUNCTION_H_
#include "BridgeJSC.h"
#include <runtime/InternalFunction.h>
#include <runtime/JSGlobalObject.h>
#include <wtf/OwnPtr.h>
namespace JSC {
class RuntimeMethod : public InternalFunction {
public:
static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
{
return new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(exec, globalObject, structure, name, methodList);
}
Bindings::MethodList* methods() const { return _methodList.get(); }
static const ClassInfo s_info;
static FunctionPrototype* createPrototype(ExecState*, JSGlobalObject* globalObject)
{
return globalObject->functionPrototype();
}
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
protected:
RuntimeMethod(ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual CallType getCallData(CallData&);
OwnPtr<Bindings::MethodList> _methodList;
};
}
#endif