pub type JSObjectGetPropertyCallback = Option<unsafe extern "C" fn(ctx: JSContextRef, object: JSObjectRef, propertyName: JSStringRef, exception: *mut JSValueRef) -> *const OpaqueJSValue>;Expand description
The callback invoked when getting a property’s value.
ctx: The execution context to use.object: TheJSObjectRefto search for the property.propertyName: AJSStringRefcontaining the name of the property to get.exception: A pointer to aJSValueRefin which to return an exception, if any.
Returns the property’s value if object has the property, otherwise NULL.
If you named your function GetProperty, you would declare it like this:
ⓘ
JSValueRef
GetProperty(JSContextRef ctx, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception);If this function returns NULL, the get request forwards to object’s
statically declared properties, then its parent class chain (which
includes the default object class), then its prototype chain.
§See also
Aliased Type§
pub enum JSObjectGetPropertyCallback {
None,
Some(unsafe extern "C" fn(*const OpaqueJSContext, *mut OpaqueJSValue, *mut OpaqueJSString, *mut *const OpaqueJSValue) -> *const OpaqueJSValue),
}