pub unsafe extern "C" fn JSObjectMake(
ctx: JSContextRef,
jsClass: JSClassRef,
data: *mut c_void,
) -> JSObjectRef
Expand description
Creates a JavaScript object.
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 initialize methods in
its class chain are called. This enables the initialize methods to
retrieve and manipulate data through JSObjectGetPrivate
.
ctx
: The execution context to use.jsClass
: TheJSClassRef
to assign to the object. PassNULL
to use the default object class.data
: Avoid*
to set as the object’s private data. PassNULL
to specify no private data.
Returns a JSObjectRef
with the given class and private data.