Entry: JS_SetParent (Function)
Summary: Sets the parent for an object.
Syntax:
JSBool JS_SetParent(JSContext *cx, JSObject *obj,
JSObject *parent);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
obj JSObject * Pointer to the object for which to set the parent.
parent JSObject * Pointer to the parent object to use.
Description:
JS_SetParent enables you to set the parent object for a specified object. A parent object is part of the enclosing scope chain for an object. Ordinarily you set a parent for an object when you create the object with JS_NewObject, but if you do not set a parent at that time, you can later call JS_SetParent to do so.
obj is a pointer to an existing JS object, and parent is a pointer to a second existing object of which the first object is a child. If JS_SetParent is successful, it returns JS_TRUE. Otherwise, if it cannot create and fill a parent slot for the object, it returns JS_FALSE.
See also:
|
|
|