Move CubicBezier RangeErrors to a single function to save 2% of file size when closure compiled