JSVAL TO OBJECT

Cast a jsval to a JSObject * without a type check.

Syntax

JSObject * JSVAL_TO_OBJECT(jsval v);

Description

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.

MXR ID Search for JSVAL_TO_OBJECT

Document Tags and Contributors

 Last updated by: Jorend,