JSBool JS_ValueToBoolean()
Description
This function extracts a function argument from a jsval structure, converts it to a Boolean value (if possible), and passes the converted value back to the caller.
Arguments
JSContext *cx, jsval v, JSBool *bp
- The
cxargument is the opaqueJSContextpointer that passes to the JavaScript function. - The
vargument is thejsvalstructure from which the Boolean value is to be extracted. - The
bpargument is a pointer to aJSBoolBoolean value. This function stores the converted value in*bp.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.