The pioneering bill squeaked through one chamber of the Legislature in Salem, but there were some Democratic dissenters.