Description
JS_SetPrivate sets the private data pointer for a specified object, obj . To set private data for an object, the object must be an instance of a class, and the class must include JSCLASS_HAS_PRIVATE in its flag set.
Only a pointer to data is stored with the object. The data pointer is converted to a jsval for storage purposes. You must free this pointer in your finalization code if you allocated storage for it. It is up to your application to maintain the actual data.
If successful, JS_SetPrivate returns JS_TRUE . Otherwise it returns JS_FALSE .
|