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