]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumberObject.h
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / runtime / NumberObject.h
index cba65dd0f724849f8da6ad7ee3737525b363f710..07334722b936fd9ab5242018fe36cf5f650ea68f 100644 (file)
 namespace JSC {
 
     class NumberObject : public JSWrapperObject {
+    protected:
+        NumberObject(JSGlobalData&, Structure*);
+        void finishCreation(JSGlobalData&);
+
     public:
-        explicit NumberObject(JSGlobalData&, Structure*);
+        typedef JSWrapperObject Base;
+
+        static NumberObject* create(JSGlobalData& globalData, Structure* structure)
+        {
+            NumberObject* number = new (NotNull, allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
+            number->finishCreation(globalData);
+            return number;
+        }
 
         static const ClassInfo s_info;
 
-        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
+        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
         {
-            return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
+            return Structure::create(globalData, globalObject, prototype, TypeInfo(NumberObjectType, StructureFlags), &s_info);
         }
-
-    private:
-        virtual JSValue getJSNumber();
     };
 
     NumberObject* constructNumber(ExecState*, JSGlobalObject*, JSValue);