JSVAL_TO_DOUBLE casts a specified JS value,
v, to a C floating-point number of type
jsdouble. As a precondition,
JSVAL_IS_DOUBLE(v) must be true. This function is not type-safe: if
v is an integer, string, null, or anything else, the behavior is undefined.
To convert any value to a number, use JS_ValueToNumber instead.