This article covers features introduced in SpiderMonkey 17
Convert any JavaScript value to a signed 64bit integer.
Syntax
bool JS::ToInt64(JSContext *cx, JS::HandleValue v, int64_t *out);
| Name | Type | Description | 
|---|---|---|
| cx | JSContext * | The context in which to perform the conversion. Requires request. In a JS_THREADSAFEbuild, the caller must be in a request on thisJSContext. | 
| v | JS::HandleValue | The value to convert. | 
| out | int64_t * | Out parameter. On success, *outreceives the converted floating-point value. | 
Description
JS::ToInt64 converts a JavaScript value to a signed 64bit integer.
On success, JS::ToInt64 stores the converted value in *out and returns true. On error or exception, it returns false, and the value left in *out is undefined.