]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/JSONObject.h
JavaScriptCore-1218.0.1.tar.gz
[apple/javascriptcore.git] / runtime / JSONObject.h
index 8d5364a36571e47dddb6c120714dc2452fa9f950..c028090831352911ab606d5c25b1bf7385ba57cc 100644 (file)
@@ -32,27 +32,37 @@ namespace JSC {
 
     class Stringifier;
 
-    class JSONObject : public JSObject {
+    class JSONObject : public JSNonFinalObject {
     public:
-        JSONObject(PassRefPtr<Structure> structure)
-            : JSObject(structure)
+        typedef JSNonFinalObject Base;
+
+        static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
+            JSONObject* object = new (NotNull, allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
+            object->finishCreation(globalObject);
+            return object;
         }
-
-        static PassRefPtr<Structure> createStructure(JSValue prototype)
+        
+        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
         {
-            return Structure::create(prototype, TypeInfo(ObjectType));
+            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
         }
+        
+        static const ClassInfo s_info;
 
-        static void markStringifiers(Stringifier*);
+    protected:
+        void finishCreation(JSGlobalObject*);
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
 
     private:
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+        JSONObject(JSGlobalObject*, Structure*);
+        static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
+        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
 
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
     };
 
+    String JSONStringify(ExecState*, JSValue, unsigned indent);
+
 } // namespace JSC
 
 #endif // JSONObject_h