JSBool JS_ValueToObject()
Description
This function extracts a function argument from a jsval structure, converts it to an object (if possible), and passes the converted value back to the caller. If the object is an array, use JS_GetArrayLength() and JS_GetElement() to read its contents.
Arguments
JSContext *cx, jsval v, JSObject **op
- The
cxargument is the opaqueJSContextpointer that passes to the JavaScript function. - The
vargument is thejsvalstructure from which the object is to be extracted. - The
opargument is a pointer to aJSObjectpointer. This function stores the converted value in*op.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.