diff options
Diffstat (limited to 'Source/JavaScriptCore/API/JSCallbackObject.h')
-rw-r--r-- | Source/JavaScriptCore/API/JSCallbackObject.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.h b/Source/JavaScriptCore/API/JSCallbackObject.h index 3acf2ef10..5022aaf40 100644 --- a/Source/JavaScriptCore/API/JSCallbackObject.h +++ b/Source/JavaScriptCore/API/JSCallbackObject.h @@ -83,13 +83,13 @@ struct JSCallbackObjectData : WeakHandleOwner { PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl()); if (location == m_propertyMap.end()) return JSValue(); - return location->value.get(); + return location->second.get(); } void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) { WriteBarrier<Unknown> empty; - m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(globalData, owner, value); + m_propertyMap.add(propertyName.impl(), empty).iterator->second.set(globalData, owner, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -100,8 +100,8 @@ struct JSCallbackObjectData : WeakHandleOwner { void visitChildren(SlotVisitor& visitor) { for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) { - if (ptr->value) - visitor.append(&ptr->value); + if (ptr->second) + visitor.append(&ptr->second); } } @@ -133,10 +133,12 @@ public: callbackObject->finishCreation(exec); return callbackObject; } - static JSCallbackObject<Parent>* create(JSGlobalData&, JSClassRef, Structure*); - - static const bool needsDestruction; - static void destroy(JSCell*); + static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure) + { + JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure); + callbackObject->finishCreation(globalData); + return callbackObject; + } void setPrivate(void* data); void* getPrivate(); @@ -171,6 +173,8 @@ protected: private: static String className(const JSObject*); + static void destroy(JSCell*); + static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); |