X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..8b637bb680022adfddad653280734877951535a9:/runtime/JSONObject.h diff --git a/runtime/JSONObject.h b/runtime/JSONObject.h index 8d5364a..c028090 100644 --- a/runtime/JSONObject.h +++ b/runtime/JSONObject.h @@ -32,27 +32,37 @@ namespace JSC { class Stringifier; - class JSONObject : public JSObject { + class JSONObject : public JSNonFinalObject { public: - JSONObject(PassRefPtr structure) - : JSObject(structure) + typedef JSNonFinalObject Base; + + static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) { + JSONObject* object = new (NotNull, allocateCell(*exec->heap())) JSONObject(globalObject, structure); + object->finishCreation(globalObject); + return object; } - - static PassRefPtr 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