How does Byte Pair Encoding work?
Your BPE vocabulary is quite small given how the strings you want to segment look like. The biggest problem here is that BPE expects tokenized sentences with tokens separated by spaces. The BPE model is not aware of JS syntax and you feed it with JS code, so there is no wonder that it does not learn anything syntactically plausible.

You can interpret the BPE file a log of what subwords got merged and you can see that the longest string you get is something like:

m').valueOf
H:mm').valueOf


I would recommend some preprocessing, perhaps some JS lexer, so it respects the syntax and perhaps bigger vocabulary.