jsval to a
JSObject * without a type check.
JSVAL_TO_OBJECT casts the argument,
v, to type
JSObject *. As a precondition,
JSVAL_IS_OBJECT(v) must be true. That is,
v must be either a reference to an object or
JSVAL_NULL. This function is not type-safe: if
v is not an object or
JSVAL_NULL, the behavior is undefined.
To convert a value to an object, use the
JS_ValueToObject function, which has well-defined behavior even when the argument is not an object or null.