#ifndef InternalFunction_h
#define InternalFunction_h
-#include "JSObject.h"
#include "Identifier.h"
+#include "JSDestructibleObject.h"
namespace JSC {
class FunctionPrototype;
- class InternalFunction : public JSObject {
+ class InternalFunction : public JSDestructibleObject {
public:
- virtual const ClassInfo* classInfo() const;
- static const ClassInfo info;
+ typedef JSDestructibleObject Base;
- const UString& name(JSGlobalData*);
+ DECLARE_EXPORT_INFO;
- static PassRefPtr<Structure> createStructure(JSValuePtr proto)
+ JS_EXPORT_PRIVATE const String& name(ExecState*);
+ const String displayName(ExecState*);
+ const String calculatedDisplayName(ExecState*);
+
+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
{
- return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot));
+ return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info());
}
protected:
- InternalFunction(PassRefPtr<Structure> structure) : JSObject(structure) { }
- InternalFunction(JSGlobalData*, PassRefPtr<Structure>, const Identifier&);
+ static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
+
+ JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*);
+
+ JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
- private:
- virtual CallType getCallData(CallData&) = 0;
+ static CallType getCallData(JSCell*, CallData&);
};
- InternalFunction* asInternalFunction(JSValuePtr);
+ InternalFunction* asInternalFunction(JSValue);
- inline InternalFunction* asInternalFunction(JSValuePtr value)
+ inline InternalFunction* asInternalFunction(JSValue value)
{
- ASSERT(asObject(value)->inherits(&InternalFunction::info));
+ ASSERT(asObject(value)->inherits(InternalFunction::info()));
return static_cast<InternalFunction*>(asObject(value));
}