You should be able to get it to throw with a call like this:
findWrapPos( "hello", 3, 0 ); // should return -1
The exception gets thrown whenever the passed-in string does not contain any spaces, tabs, or newlines. It looks like line 914 was also expecting line 908 to have a <.
Also, I think there are other bugs. In this call:
findWrapPos( "helloooo\noo\ngoodbye", 6, 7 ); // should return 8
we want it to short circuit and return the first newline if there is one in the substring starting at 7 with width 6 ("o\noo\ng"), and so it should return the index of the first '\n', which is 8. However, on lines 876 and 877, it's doing "pos <= width", instead of "pos <= startPos+width", so it won't return, and it will end up (incorrectly, I think) returning the index of the second newline's position. And once you fix lines 876 and 877, it's going to return 9 instead of 8, which I think is incorrect. The other return statements return pos, not pos+1, and I think line 879 should do the same.