Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

JSVAL_TO_OBJECT

Obsolete since JSAPI 32
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

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.

See Also

Document Tags and Contributors

 Contributors to this page: arai, fscholz, Jorend, Rappo
 Last updated by: arai,