]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/MathObject.h
JavaScriptCore-7600.1.4.16.1.tar.gz
[apple/javascriptcore.git] / runtime / MathObject.h
index 75753be2922e9b794be2a14820bd5af8175f48f5..4b2a5bbece04dd2d30ce25d5e3775a3fe289e25a 100644 (file)
 #ifndef MathObject_h
 #define MathObject_h
 
-#include "JSObjectWithGlobalObject.h"
+#include "JSObject.h"
 
 namespace JSC {
 
-    class MathObject : public JSObjectWithGlobalObject {
+    class MathObject : public JSNonFinalObject {
+    private:
+        MathObject(VM&, Structure*);
+
     public:
-        MathObject(ExecState*, JSGlobalObject*, Structure*);
+        typedef JSNonFinalObject Base;
 
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
+        static MathObject* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
+        {
+            MathObject* object = new (NotNull, allocateCell<MathObject>(vm.heap)) MathObject(vm, structure);
+            object->finishCreation(vm, globalObject);
+            return object;
+        }
 
-        static const ClassInfo s_info;
+        DECLARE_INFO;
 
-        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
+        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
         {
-            return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
+            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
         }
 
     protected:
+        void finishCreation(VM&, JSGlobalObject*);
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
     };