pub unsafe extern "C-unwind" fn JSObjectMake(
ctx: JSContextRef,
js_class: JSClassRef,
data: *mut c_void,
) -> JSObjectRef
Available on crate features
JSObjectRef
and JSBase
only.Expand description
Creates a JavaScript object.
Parameter ctx
: The execution context to use.
Parameter jsClass
: The JSClass to assign to the object. Pass NULL to use the default object class.
Parameter data
: A void* to set as the object’s private data. Pass NULL to specify no private data.
Returns: A JSObject with the given class and private data.
The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data.
data is set on the created object before the intialize methods in its class chain are called. This enables the initialize methods to retrieve and manipulate data through JSObjectGetPrivate.