X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..14957cd040308e3eeec43d26bae5d76da13fcd85:/runtime/StringObject.h diff --git a/runtime/StringObject.h b/runtime/StringObject.h index 540c576..4c16044 100644 --- a/runtime/StringObject.h +++ b/runtime/StringObject.h @@ -28,42 +28,38 @@ namespace JSC { class StringObject : public JSWrapperObject { public: - StringObject(ExecState*, PassRefPtr); - StringObject(ExecState*, PassRefPtr, const UString&); + StringObject(ExecState*, Structure*); + StringObject(ExecState*, Structure*, const UString&); - static StringObject* create(ExecState*, JSString*); + static StringObject* create(ExecState*, JSGlobalObject*, JSString*); virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); + virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); - virtual void put(ExecState* exec, const Identifier& propertyName, JSValuePtr, PutPropertySlot&); + virtual void put(ExecState* exec, const Identifier& propertyName, JSValue, PutPropertySlot&); virtual bool deleteProperty(ExecState*, const Identifier& propertyName); - virtual void getPropertyNames(ExecState*, PropertyNameArray&); + virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); - virtual const ClassInfo* classInfo() const { return &info; } - static const ClassInfo info; + static const JS_EXPORTDATA ClassInfo s_info; JSString* internalValue() const { return asString(JSWrapperObject::internalValue());} - static PassRefPtr createStructure(JSValuePtr prototype) + static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType)); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: - StringObject(PassRefPtr, JSString*); + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags; + StringObject(JSGlobalData&, Structure*, JSString*); + }; - private: - virtual UString toString(ExecState*) const; - virtual UString toThisString(ExecState*) const; - virtual JSString* toThisJSString(ExecState*); - }; + StringObject* asStringObject(JSValue); - StringObject* asStringObject(JSValuePtr); - - inline StringObject* asStringObject(JSValuePtr value) + inline StringObject* asStringObject(JSValue value) { - ASSERT(asObject(value)->inherits(&StringObject::info)); + ASSERT(asObject(value)->inherits(&StringObject::s_info)); return static_cast(asObject(value)); }