Good catch @sokra. Yes, this should result in "/b". Can you add this assertion as well:

    assert.equal(libUtil.join("http://example.com/foo", "//bar"), "http://example.com/bar");

Thanks.