Retrieves an object's prototype.
JSObject * JS_GetPrototype(JSContext *cx, JSObject *obj);
| Name | Type | Description |
|---|---|---|
cx |
JSContext * |
Pointer to a JS context from which to derive runtime information.
Requires request. (In a JS_THREADSAFE build, the caller must be in a request on this JSContext.)
|
obj |
JSObject * |
Object for which to retrieve the prototype. |
JS_GetPrototype retrieves the prototype of a specified object, obj. A prototype object provides properties inherited by similar JS objects.
If obj has a prototype, JS_GetPrototype returns a pointer to the prototype. Otherwise, it returns NULL.
To set an object's prototype, use JS_SetPrototype.
Page last modified 20:01, 5 Sep 2008 by Jorend