JSVAL TO OBJECT
From MDC
Convert a jsval to a JSObject * without any type checking or error handling.
[edit] Syntax
JSVAL_TO_OBJECT(v)
[edit] Description
JSVAL_TO_OBJECT casts the specified JS value, v, to type JSObject *. The argument v must be a jsval, and it must refer to an object or be JSVAL_NULL. It must not be a string or number, for example.
The JSVAL_TO_OBJECT macro is implemented using a C cast. It is not type-safe and does not check that v is the right type. If v is not actually a reference to an object or JSVAL_NULL, the result is unspecified. To avoid crashing, the program can check the type of v beforehand using JSVAL_IS_OBJECT.
Note that the JavaScript undefined value (JSVAL_VOID) is neither an object nor JSVAL_NULL, so it cannot safely be passed to JSVAL_TO_OBJECT.
To convert a JS value to an object, use the JS_ValueToObject function, which has well-defined behavior even when the argument is not an object or null.
[edit] See Also
LXR ID Search for JSVAL_TO_OBJECT
DOUBLE_TO_JSVAL, JSVAL_TO_DOUBLE, JSVAL_TO_GCTHING, JSVAL_TO_STRING, OBJECT_TO_JSVAL, STRING_TO_JSVAL