| ||||||||||||
SummaryConverts a JS value to a JS 32-bit integer. | ||||||||||||
SyntaxJSBool JS_ValueToInt32(JSContext *cx, jsval v, int32 *ip);
| ||||||||||||
DescriptionJS_ValueToInt32 converts a specified JS value, v , to a 32-bit integer (-2147483648 to 2147483647). If v is NaN, or a double and out of the 32-bit range, JS_ValueToInt32 reports an error and conversion fails. A double is rounded to the nearest integer value.
The actual conversion is performed by the object's convert operation. The converted value is stored in the
You can convert a JS value to an integer if the JS value to convert is a
If the conversion is successful,
| ||||||||||||
See Also
|