The callback invoked when deleting a property.
SDKs
- iOS 7.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Java
Script Core
Declaration
typealias JSObjectDeletePropertyCallback = (JSContext Ref?, JSObject Ref?, JSString Ref?, Unsafe Mutable Pointer<JSValue Ref?>?) -> Bool
Parameters
ctx
The execution context to use.
object
The JSObject in which to delete the property.
propertyName
A JSString containing the name of the property to delete.
exception
A pointer to a JSValueRef in which to return an exception, if any.
Return Value
true if propertyName was successfully deleted, otherwise false.
Discussion
If you named your function DeleteProperty, you would declare it like this:
bool DeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
If this function returns false, the delete request forwards to object's statically declared properties, then its parent class chain (which includes the default object class).