Access the private data field of an object.
void * JS_GetPrivate(JSObject *obj);
| || ||An object whose |
New objects' private data fields are initially
Warning: It is dangerous to call
JS_GetPrivate on a
JSObject * unless the object's
JSClass is known. If the object is not of the expected
JSClass, the result of
JS_GetPrivate would probably be
NULL or a pointer to some unexpected type of data. Casting that pointer to the desired type and using it could then cause a crash or worse.