I have a issue with split_lines. After splitting (and before inserting comments) code became:
code,code,"yUglify: preserved comment block"
,code,code
I.e. code wraps right after comment. After than replacing comments replaces "preserved comment block" without comma. As a result code become:
code,code,
/* comment
*/
,code,code
I.e. two commas are following each other (with comment between). This causes the error.
You should swap split_lines and code.replace(reTokens, …).