I would argue that searching nothing in nothing is wrong. IMO a test that compares the behavior of
indexOf("", "") == indexOfIdx("", "", 0) is the best way to have consistency.