I'd prefer this parameter be called `limit`, and set to 1 or Infinity as appropriate. As it stands, `traverseParents` has too much knowledge of what `closest` requires of it. (I know this isn't what I suggested originally, but it is a slightly cleaner approach.)