Oops. That documentation looks like a copy/paste error on my part.
If you look at the implementation, there is a link to the place where I got the code
You'll notice the http://www.movable-type.co.uk/scripts/latlong.html link. Anyway, bearingHaversine is different than midpoint. Check out the link under the Bearing and Midpoint pages for a better description. If you have time to fix that documentation and submit a pull request, I'd really appreciate it.