Entry: JS_ValueToObject (Function)
Summary: Converts a JS value to a JS object.
Syntax:
JSBool JS_ValueToObject(JSContext *cx, jsval v,
JSObject **objp);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
v jsval The JS value to convert.
objp JSObject ** Pointer to the JS object into which to store the converted value.
Description:
JS_ValueToObject converts a specified JS value, v, to a JS object. The converted object is stored in the object pointed to by objp. If the conversion is successful, JS_ValueToObject returns JS_TRUE. Otherwise it returns JS_FALSE.
You can successfully convert a JS value to an object if the JS value to convert is one of JSVAL_INT, JSVAL_DOUBLE, JSVAL_STRING, JSVAL_BOOLEAN, or JSVAL_OBJECT. Note that if v is already an object, the object returned in objp represents a converted version of v, rather than original version of v.
See also:
|
|
|