JavaScript-1.5 Reference

JS_GetPrivate Function

Summary

Retrieves the private data associated with an object.

Syntax

void * JS_GetPrivate(JSContext *cx, JSObject *obj);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Object for which to retrieve private data.

Description

JS_GetPrivate retrieves the private data associated with a specified object, obj. To retrieve private data, an object must be an instance of a class, and that class must include the JSCLASS_HAS_PRIVATE flag.

If successful, JS_GetPrivate returns a pointer to the private data. Otherwise it returns NULL which can mean either that there is no private data currently associated with the object, or that the object cannot have private data.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JSCLASS_HAS_PRIVATE | JSClass | JSVAL_TO_PRIVATE | JS_GetInstancePrivate | JS_InitClass | JS_SetPrivate ]

This page was generated by APIDOC