When checking the polygon's vertices for uniqueness, the following is implemented:
if (v.distanceToSquared(points[j]) < 0.5 * settings.linearSlop)
linearSlop is said to be in distance units, not squared, so here one should use settings.linearSlop * settings.linearSlop like it's done in all other places.
This prevents polygons with seemingly legal point distance (e.g 0.04 vs slop = 0.005) being created.