Currently it is impossible to delete static properties defined via the C API from API objects.
Created attachment 203013 [details] Patch
Comment on attachment 203013 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203013&action=review > Source/JavaScriptCore/ChangeLog:21 > + (JSC::::getOwnPropertySlot): The script screws up parsing these function names. You should put in the JSCallbackObject part by hand if you are leaving these lines in. > Source/JavaScriptCore/API/JSCallbackObject.h:82 > + if (!m_deletedStaticProperties) > + return false; > + return m_deletedStaticProperties->contains(name); I like to write these with && instead of an early return.
Is there a similar issue for the Objective-C API?
(In reply to comment #3) > Is there a similar issue for the Objective-C API? I don't think so. We don't really have a concept of static functions in the Objective-C API. All properties are real properties on the underlying JS wrapper objects. The accessors added to the JS wrappers for Objective-C @properties are set to be "configurable" which means they can be deleted.
Comment on attachment 203013 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203013&action=review This patch will remove the *interface* for a static property in response to a delete request -- I don't think that's quite what our client wanted. They wanted an object that could implement a custom property, but store the backing for that property in normal object backing, and then use delete to remove it. Maybe we need to clear this up with them. > Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:393 > + thisObject->m_callbackObjectData->deleteStaticProperty(name); > + bool result = Parent::deleteProperty(thisObject, exec, propertyName); > + ASSERT(result); > + return result; This isn't quite right. We should only call through to Parent::deleteProperty() if we did not find a static property to delete, and our return value should depend on whether we found anything to delete. > Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:406 > + thisObject->m_callbackObjectData->deleteStaticProperty(name); > + bool result = Parent::deleteProperty(thisObject, exec, propertyName); > + ASSERT(result); > + return result; Ditto.