I noticed that if you passed in just a number, JS would helpfully parse that and then `source.length` was undefined, which broke the lexer.
It's a little hacky and not very clean but it's working for now.