The error is due to an error converting the coordinates of the gradient from double to float and can be fixed by forcing the radial gradient coordinates to be Int32s
Bitwise or with 0 will convert from JS Number to Int32 (signed integer 32bits) and fix the problem.
var gradient = ctx.createRadialGradient(
grad_x0 | 0,
grad_y0 | 0,
options.radius | 0,
options.x0 | 0,
options.y0 | 0,
0
);