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.
JSBool JSVAL_TO_BOOLEAN(jsval v);
JSVAL_TO_BOOLEAN casts the value
v to a C integer, either 0 or 1. As a precondition,
must be true. That is,
v must be either
JSVAL_FALSE. Otherwise the behavior is undefined.
The result is
JS_FALSE respectively. These are constants of type
JSBool, which is an integer type, the SpiderMonkey version of
To convert any value to a boolean, use
JS_ValueToBoolean instead. That function has well-defined behavior even when the argument is an object, number, or something else.
To convert a